Skip to content

Commit ef89938

Browse files
committed
Added a few docstrings, refs #11.
1 parent 33ddab6 commit ef89938

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

api/models.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ def __str__(self):
9393
@python_2_unicode_compatible
9494
class ProviderManager(models.Manager):
9595

96+
"""Manages database interactions for Provider objects."""
97+
9698
def seed(self, user, **kwargs):
99+
"""Seeds the database with Providers for clouds supported by deis.
100+
101+
:param user: who will own the Providers
102+
:type user: a deis user
103+
"""
97104
providers = (('ec2', 'ec2'),)
98105
for p_id, p_type in providers:
99106
self.create(owner=user, id=p_id, type=p_type, creds='{}')
@@ -124,7 +131,10 @@ class Meta:
124131
@python_2_unicode_compatible
125132
class FlavorManager(models.Manager):
126133

134+
"""Manages database interactions for Flavors."""
135+
127136
def load_cloud_config_base(self):
137+
"""Read the base configuration file and return the YAML data it contains."""
128138
# load cloud-config-base yaml_
129139
_cloud_config_path = os.path.abspath(
130140
os.path.join(__file__, '..', 'files', 'cloud-config-base.yml'))
@@ -133,6 +143,7 @@ def load_cloud_config_base(self):
133143
return yaml.safe_load(_data)
134144

135145
def seed(self, user, **kwargs):
146+
"""Seed the database with default Flavors for each cloud region."""
136147
# TODO: add optimized AMIs to default flavors
137148
flavors = (
138149
{'id': 'ec2-us-east-1',

0 commit comments

Comments
 (0)