cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [02/50] cloudstack-ec2stack git commit: Make new comments consistent with previous
Date Tue, 05 May 2015 13:25:55 GMT
Make new comments consistent with previous


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/commit/53200c2e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/tree/53200c2e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/diff/53200c2e

Branch: refs/heads/master
Commit: 53200c2e3011e2bccf6c6f029ef2d421d00a045f
Parents: 6f94bae
Author: BroganD1993 <darrenbrogan@hotmail.com>
Authored: Wed Jul 9 19:49:19 2014 +0100
Committer: BroganD1993 <darrenbrogan@hotmail.com>
Committed: Wed Jul 9 19:49:19 2014 +0100

----------------------------------------------------------------------
 ec2stack/__init__.py  |  7 ++++++-
 ec2stack/configure.py | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/53200c2e/ec2stack/__init__.py
----------------------------------------------------------------------
diff --git a/ec2stack/__init__.py b/ec2stack/__init__.py
index ac6b8bb..91ca81d 100644
--- a/ec2stack/__init__.py
+++ b/ec2stack/__init__.py
@@ -49,7 +49,9 @@ def create_app(settings=None):
 
 def _generate_args():
     """
-    Generate command line arguments for ec2stack.
+    Generate command line arguments for ec2stack-configure.
+
+    @return: args.
     """
     parser = argparse.ArgumentParser()
 
@@ -94,6 +96,9 @@ def _load_config_file():
 def _config_from_config_profile(config_file, profile, app):
     """
     Configures ec2stack app based on configuration profile.
+
+    @param config_file: current config file configuration.
+    @param profile: the profile to set the attribute in.
     """
     config = SafeConfigParser()
     config.read(config_file)

http://git-wip-us.apache.org/repos/asf/cloudstack-ec2stack/blob/53200c2e/ec2stack/configure.py
----------------------------------------------------------------------
diff --git a/ec2stack/configure.py b/ec2stack/configure.py
index 62f3438..93b4649 100644
--- a/ec2stack/configure.py
+++ b/ec2stack/configure.py
@@ -52,6 +52,8 @@ def _create_config_file(config_folder):
 def _generate_args():
     """
     Generate command line arguments for ec2stack-configure.
+
+    @return: args.
     """
     parser = argparse.ArgumentParser(
         'Command line utility for configuring ec2stack'
@@ -73,6 +75,10 @@ def _generate_args():
 def _modify_config_profile(config_file, profile):
     """
     Modify configuration profile.
+
+    @param config_file: current config file configuration.
+    @param profile: the profile to set the attribute in.
+    @return: configparser configuration.
     """
     config = SafeConfigParser()
     config.read(config_file)
@@ -117,6 +123,10 @@ def _modify_config_profile(config_file, profile):
 def _set_optional_attributes_of_profile(config, profile):
     """
     Modify optional attributes of profile.
+
+    @param config: current configparser configuration.
+    @param profile: the profile to set the attribute in.
+    @return: configparser configuration.
     """
     configure_instance_type_mapings = raw_input(
         'Do you wish to input instance type mappings? (Yes/No): '
@@ -139,6 +149,10 @@ def _set_optional_attributes_of_profile(config, profile):
 def _read_user_instance_mappings(config, profile):
     """
     Add instance type mappings to profile.
+
+    @param config: current configparser configuration.
+    @param profile: the profile to set the attribute in.
+    @return: configparser configuration.
     """
     instance_section = profile + "instancemap"
     if not config.has_section(instance_section):
@@ -166,6 +180,10 @@ def _read_user_instance_mappings(config, profile):
 def _read_user_resource_type_mappings(config, profile):
     """
     Add resource type mappings to profile.
+
+    @param config: current configparser configuration.
+    @param profile: the profile to set the attribute in.
+    @return: configparser configuration.
     """
     resource_section = profile + "resourcemap"
     if not config.has_section(resource_section):
@@ -191,6 +209,16 @@ def _read_user_resource_type_mappings(config, profile):
 
 
 def _set_attribute_of_profile(config, profile, attribute, message, default):
+    """
+    Set attribute of profile
+
+    @param config: current configparser configuration.
+    @param profile: the profile to set the attribute in.
+    @param attribute: the attribute to set.
+    @param message: the message to prompt the user with.
+    @param default: the default value to use if none is entered.
+    @return: configparser configuration.
+    """
     if config.has_option(profile, attribute):
         default = config.get(profile, attribute)
 
@@ -201,6 +229,13 @@ def _set_attribute_of_profile(config, profile, attribute, message, default):
 
 
 def _read_in_config_attribute_or_use_default(message, default):
+    """
+    Add resource type mappings to profile.
+
+    @param message: the message to prompt the user with.
+    @param default: the default value to use if none is entered.
+    @return: configparser configuration.
+    """
     attribute = raw_input(message + ' [' + default + ']: ')
     if attribute == '':
         attribute = default


Mime
View raw message