Skip to content
Permalink
Browse files
Reread all module comments, fix anything inconsistent
  • Loading branch information
brogand93 committed Mar 10, 2014
1 parent 0128d1b commit 2f57c3fe4783344441e36aea5a845f54291ba46f
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 33 deletions.
@@ -19,7 +19,7 @@ def create_app(settings=None):
Creates a flask application.
@param settings: Settings override object.
@return: The flask application
@return: The flask application.
"""
app = Flask(__name__)

@@ -45,9 +45,9 @@ def create_app(settings=None):

def _load_config_file():
"""
Checks that the users configuration file exists and returns its path.
Checks that the user's configuration file exists and returns its path.
@return: The path to the users configuration file.
@return: The path to the user's configuration file.
"""
config_file = os.path.join(
os.path.expanduser('~'),
@@ -77,9 +77,9 @@ def _valid_config_file(app):

def _load_database():
"""
Checks that the users database exists and returns its uri.
Checks that the user's database exists and returns its uri.
@return: The uri to the users database.
@return: The uri to the user's database.
"""
database_file = os.path.join(
os.path.expanduser('~'),
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8

"""This module is used to launch EC2Stack
"""This module is used to launch EC2Stack.
"""

from werkzeug.serving import run_simple
@@ -22,7 +22,7 @@ def main():

def _create_config_folder():
"""
Creates a folder to hold the users configurations files.
Creates a folder to hold the user's configuration files.
@return: Path of the configuration folder.
"""
@@ -85,10 +85,10 @@ def _get_action(action):

def register_secret_key():
"""
Register a user's API key and secret key
Register a user's API key and secret key.
@return: Response.
@raise Ec2stackError: API key already being registered.
@raise Ec2stackError: API key already registered.
"""
require_parameters({'AWSAccessKeyId', 'AWSSecretKey'})
found_user = USERS.get(get('AWSAccessKeyId'))
@@ -38,7 +38,7 @@ def save(self, model):
Saves the given Model.
@param model: The model to be saved.
@return: The saved model
@return: The saved model.
"""
self._isinstance(model)
DB.session.add(model)
@@ -65,7 +65,7 @@ def create(self, **kwargs):

def delete(self, model):
"""
Deletes the given model
Deletes the given model.
@param model: Model to be deleted.
"""
@@ -48,7 +48,7 @@ def invalid_instance_id():

def invalid_zone():
"""
Invalid Zone
Invalid Zone.
@raise Ec2stackError: Defining a bad request and message.
"""
@@ -74,7 +74,7 @@ def invalid_volume_id():

def invalid_volume_attached():
"""
Invalid volume attached storage.
Invalid volume, volume is already attached.
@raise Ec2stackError: Defining a bad request and message.
"""
@@ -87,7 +87,7 @@ def invalid_volume_attached():

def invalid_volume_detached():
"""
Invalid volume detached.
Invalid volume, volume is already detached.
@raise Ec2stackError: Defining a bad request and message.
"""
@@ -100,7 +100,7 @@ def invalid_volume_detached():

def invalid_disk_offering_name():
"""
Invalid disk offering id
Invalid disk offering id.
@raise Ec2stackError: Defining a bad request and message.
"""
@@ -113,7 +113,7 @@ def invalid_disk_offering_name():

def invalid_service_offering_name():
"""
Invalid Service Offering name
Invalid Service Offering name.
@raise Ec2stackError: Defining a bad request and message.
"""
@@ -37,7 +37,7 @@ def get(item, data=None):

def authentication_required(f):
"""
Checked that the given signature is valid.
Check that the given signature is valid.
@param f: Function to wrap around.
@return: Result of signature check.
@@ -203,7 +203,7 @@ def generate_signature(data=None, method=None, host=None, path=None):
@param method: HTTP method used.
@param host: HTTP post.
@param path: HTTP hort.
@return: A signatured.
@return: A signature.
"""
if data is None:
data = request.form
@@ -231,7 +231,7 @@ def generate_signature(data=None, method=None, host=None, path=None):

def _get_request_string(data, method=None, host=None, path=None):
"""
Creates the request string
Creates the request string.
@param data: Data of the request.
@param method: HTTP method used.
@@ -28,7 +28,7 @@ def describe_item(args, keyname, not_found, prefix):

def _describe_specific_item(args, keyname, not_found, prefix):
"""
Describe a specific item based on args['id'] or args['name']
Describe a specific item based on args['id'] or args['name'].
@param args: Arguments involved in the request.
@param keyname: Keyname of the Cloudstack response.
@@ -2,7 +2,7 @@
# encoding: utf-8

"""This module contains functions for handling requests in relation to disk
offerings
offerings.
"""

from ec2stack import errors
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8

"""This module contains functions for handling requests in relation to images
"""This module contains functions for handling requests in relation to images.
"""

from ec2stack import helpers, errors
@@ -1,7 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8

"""This module contains functions for handling requests in relation to instances
"""This module contains functions for handling requests in relation to
instances.
"""

from flask import current_app
@@ -14,7 +15,7 @@
@helpers.authentication_required
def describe_instance_attribute():
"""
Describes an instance attribute
Describes an instance attribute.
@return: Response.
"""
@@ -90,7 +91,7 @@ def describe_instance_by_id(instance_id):

def _describe_instances_response(response):
"""
Generates a response for a describe instance request
Generates a response for a describe instance request.
@param response: Response from Cloudstack.
@return: Response.
@@ -222,7 +223,7 @@ def _reboot_instance_request(instance_id):
"""
Request to reboot an instance.
@param instance_id: Id of instance to be rebooted
@param instance_id: Id of instance to be rebooted.
@return: Response.
"""
args = {'command': 'rebootVirtualMachine',
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8

"""This module contains functions for handling requests in relation to keypairs
"""This module contains functions for handling requests in relation to keypairs.
"""

from base64 import b64decode
@@ -2,7 +2,7 @@
# encoding: utf-8

"""This module contains functions for handling requests in relation to password
data
data.
"""

from ec2stack import helpers, errors
@@ -53,7 +53,7 @@ def make_request(args):

def make_request_async(args, poll_period=2, timeout=3600):
"""
Makes an async request to Cloudstack
Makes an async request to Cloudstack.
@param args: Request payload.
@param poll_period: Poll time period.
@@ -2,7 +2,7 @@
# encoding: utf-8

"""This module contains functions for handling requests in relation to service
offerings
offerings.
"""

from ec2stack import errors
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8

"""This module contains functions for handling requests in relation to zones
"""This module contains functions for handling requests in relation to zones.
"""

from ec2stack.providers import cloudstack
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8

"""This module provides functions to register AWSAccessKeyIds and AWSSecretKeys
"""This module provides functions to register AWSAccessKeyIds and AWSSecretKeys.
"""

import argparse
@@ -15,7 +15,7 @@ def _generate_args(description):
Generates the base application with required parameters.
@param description: Description of the command.
@return: the args associated with the command.
@return: The args associated with the command.
"""
parser = argparse.ArgumentParser(
description=description

0 comments on commit 2f57c3f

Please sign in to comment.