How can I order the variable "changes" by the order in the variable ordered_stacks?
def do_autoupdate_environment(domain=None, dryrun=False, deployid= None, exclude=[], methods= None):
# TODO: list of stacks in order:
# This is done in the get_update_method and update_stack method
from fabfile.cloud.gitter import has_updates
ordered_stacks = [
"vpc",
"zookeeper",
"activemq",
"mesos",
"consul",
"app",
"storm",
"logging",
"redis",
"rds",
"buckets",
]
reports = OrderedDict()
changes = methods.check_env(domain)
print "DEBUG changes (variable): "
print changes
This is the output:
DEBUG changes (variable):
[{'TemplateBasename': u'app', 'DeployedRelease': 'app-0.10.7', 'StackName': 'test-app', 'CurrentRelease': 'app-0.10.8', 'TemplateFile': u'config/app/app.json', 'DeployedCommit': 'app-0.10.7'}, {'TemplateBasename': u'consul', 'DeployedRelease': 'consul0.7.0-e91c825', 'StackName': 'test-consul', 'CurrentRelease': 'consul-0.7.3', 'TemplateFile': u'config/consul/consul.json', 'DeployedCommit': 'e91c825'}, {'TemplateBasename': u'local-registry', 'DeployedRelease': 'local-registry0.5.4', 'StackName': 'test-localregistry', 'CurrentRelease': 'local-registry-0.5.7', 'TemplateFile': u'config/local-registry/local-registry.json', 'DeployedCommit': 'local-registry0.5.4'}, {'TemplateBasename': u'logging', 'DeployedRelease': 'logging0.6.4', 'StackName': 'test-logging', 'CurrentRelease': 'logging-0.6.7', 'TemplateFile': u'config/logging/logging.json', 'DeployedCommit': 'logging0.6.4'}, {'TemplateBasename': u'mesos', 'DeployedRelease': 'mesos-0.8.4-aadfa8f', 'StackName': 'test-mesos', 'CurrentRelease': 'mesos-0.8.7', 'TemplateFile': u'config/mesos/mesos.json', 'DeployedCommit': 'aadfa8f'}, {'TemplateBasename': u'rds', 'DeployedRelease': 'rds-0.4.4-aa81f19', 'StackName': 'test-rds', 'CurrentRelease': 'rds-0.4.5', 'TemplateFile': u'config/rds/rds.json', 'DeployedCommit': 'aa81f19'}, {'TemplateBasename': u'vpc', 'DeployedRelease': 'vpc-0.7.3-eac082f1', 'StackName': 'test-vpc', 'CurrentRelease': 'vpc-0.7.4', 'TemplateFile': u'config/vpc/vpc.json', 'DeployedCommit': 'eac082f1'}, {'TemplateBasename': u'zookeeper', 'DeployedRelease': 'zookeeper-0.6.7-3fda88b', 'StackName': 'test-zookeeper', 'CurrentRelease': 'zookeeper-0.6.9', 'TemplateFile': u'config/zookeeper/zookeeper.json', 'DeployedCommit': '3fda88b'}]
Comments
Post a Comment