Correct todo messages.
Change-Id: I4a41ffdd82da7b3abb4c92d2db945480b88cabd9
This commit is contained in:
parent
0a1819810e
commit
1030001889
@ -35,6 +35,6 @@ def parse_configs(argv=None, conf_files=None):
|
||||
try:
|
||||
CONF(ARGV, project='savanna', default_config_files=conf_files)
|
||||
except cfg.RequiredOptError as roe:
|
||||
# todo replace RuntimeError with Savanna-specific exception
|
||||
# TODO(slukjanov): replace RuntimeError with Savanna-specific exception
|
||||
raise RuntimeError("Option '%s' is required for config group "
|
||||
"'%s'" % (roe.opt_name, roe.group.name))
|
||||
|
@ -46,7 +46,7 @@ _CTXS = threading.local()
|
||||
|
||||
def ctx():
|
||||
if not hasattr(_CTXS, '_curr_ctx'):
|
||||
# todo replace with specific error
|
||||
# TODO(slukjanov): replace with specific error
|
||||
raise RuntimeError("Context isn't available here")
|
||||
return _CTXS._curr_ctx
|
||||
|
||||
|
@ -39,7 +39,7 @@ class Cluster(mb.SavannaBase, mb.IdMixin, mb.TenantMixin,
|
||||
cluster_configs = sa.Column(st.JsonDictType())
|
||||
node_groups = relationship('NodeGroup', cascade="all,delete",
|
||||
backref='cluster')
|
||||
# todo replace String type with sa.Enum(*CLUSTER_STATUSES)
|
||||
# TODO(slukjanov): replace String type with sa.Enum(*CLUSTER_STATUSES)
|
||||
status = sa.Column(sa.String(80))
|
||||
status_description = sa.Column(sa.String(200))
|
||||
private_key = sa.Column(sa.Text, default=crypto.generate_private_key())
|
||||
@ -192,7 +192,7 @@ class ClusterTemplate(mb.SavannaBase, mb.IdMixin, mb.TenantMixin,
|
||||
description = sa.Column(sa.String(200))
|
||||
cluster_configs = sa.Column(st.JsonDictType())
|
||||
|
||||
# todo add node_groups_suggestion helper
|
||||
# TODO(slukjanov): add node_groups_suggestion helper
|
||||
|
||||
def __init__(self, name, tenant_id, plugin_name, hadoop_version,
|
||||
cluster_configs=None, description=None):
|
||||
@ -253,7 +253,7 @@ class NodeGroupTemplate(mb.SavannaBase, mb.IdMixin, mb.TenantMixin,
|
||||
node_group_template_id=self.id, **additional_values)
|
||||
|
||||
|
||||
# todo it should be replaced with NodeGroup-based relation
|
||||
# TODO(slukjanov): it should be replaced with NodeGroup-based relation
|
||||
class TemplatesRelation(mb.SavannaBase, mb.IdMixin):
|
||||
"""NodeGroupTemplate - ClusterTemplate relationship."""
|
||||
|
||||
|
@ -18,7 +18,7 @@ import savanna.db.models as m
|
||||
|
||||
|
||||
## Cluster ops
|
||||
# todo check tenant_id and etc.
|
||||
# TODO(slukjanov): check tenant_id and etc.
|
||||
|
||||
def get_clusters(**args):
|
||||
return ctx.model_query(m.Cluster).filter_by(**args).all()
|
||||
|
@ -79,7 +79,7 @@ def make_app():
|
||||
|
||||
@app.teardown_request
|
||||
def teardown_request(_ex=None):
|
||||
# todo how it'll work in case of exception?
|
||||
# TODO(slukjanov): how it'll work in case of exception?
|
||||
session = context.session()
|
||||
if session.transaction:
|
||||
session.transaction.commit()
|
||||
|
@ -129,17 +129,17 @@ class PluginManager(object):
|
||||
plugin_path = CONF['plugin:%s' % plugin_name].plugin_class
|
||||
module_path, klass = [s.strip() for s in plugin_path.split(':')]
|
||||
if not module_path or not klass:
|
||||
# todo replace with specific error
|
||||
# TODO(slukjanov): replace with specific error
|
||||
raise RuntimeError("Incorrect plugin_class: '%s'" %
|
||||
plugin_path)
|
||||
module = importutils.try_import(module_path)
|
||||
if not hasattr(module, klass):
|
||||
# todo replace with specific error
|
||||
# TODO(slukjanov): replace with specific error
|
||||
raise RuntimeError("Class not found: '%s'" % plugin_path)
|
||||
|
||||
plugin_class = getattr(module, klass)
|
||||
if not inspect.isclass(plugin_class):
|
||||
# todo replace with specific error
|
||||
# TODO(slukjanov): replace with specific error
|
||||
raise RuntimeError("'%s' isn't a class" % plugin_path)
|
||||
|
||||
plugin = plugin_class()
|
||||
|
@ -95,7 +95,7 @@ class Config(resources.BaseResource):
|
||||
|
||||
def to_dict(self):
|
||||
res = super(Config, self).to_dict()
|
||||
# todo all custom fields from res
|
||||
# TODO(slukjanov): all custom fields from res
|
||||
return res
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -33,14 +33,14 @@ def create_cluster(values):
|
||||
cluster = s.create_cluster(values)
|
||||
plugin = plugin_base.PLUGINS.get_plugin(cluster.plugin_name)
|
||||
|
||||
# todo validate configs and etc.
|
||||
# TODO(slukjanov): validate configs and etc.
|
||||
|
||||
# validating cluster
|
||||
cluster.status = 'Validating'
|
||||
context.model_save(cluster)
|
||||
plugin.validate(cluster)
|
||||
|
||||
# todo run all following commands in background thread
|
||||
# TODO(slukjanov): run all following commands in background thread
|
||||
|
||||
# updating cluster infra
|
||||
cluster.status = 'InfraUpdating'
|
||||
|
@ -110,7 +110,7 @@ def _check_if_up(instance):
|
||||
|
||||
server = instance.nova_info
|
||||
if server.status == 'ERROR':
|
||||
# todo replace with specific error
|
||||
# TODO(slukjanov): replace with specific error
|
||||
raise RuntimeError("node %s has error status" % server.name)
|
||||
|
||||
if server.status != 'ACTIVE':
|
||||
@ -120,7 +120,7 @@ def _check_if_up(instance):
|
||||
return False
|
||||
|
||||
if instance.management_ip is None:
|
||||
# todo support floating ips and different networks
|
||||
# TODO(slukjanov): support floating ips and different networks
|
||||
ip = server.networks.values()[0][1]
|
||||
if not ip:
|
||||
return False
|
||||
|
@ -35,7 +35,7 @@ class JSONEncoded(st.TypeDecorator):
|
||||
return value
|
||||
|
||||
|
||||
# todo verify this implementation
|
||||
# TODO(slukjanov): verify this implementation
|
||||
class MutableDict(mutable.Mutable, dict):
|
||||
@classmethod
|
||||
def coerce(cls, key, value):
|
||||
@ -65,7 +65,7 @@ class MutableDict(mutable.Mutable, dict):
|
||||
self.changed()
|
||||
|
||||
|
||||
# todo verify this implementation
|
||||
# TODO(slukjanov): verify this implementation
|
||||
class MutableList(mutable.Mutable, list):
|
||||
@classmethod
|
||||
def coerce(cls, key, value):
|
||||
|
Loading…
Reference in New Issue
Block a user