本文整理汇总了Python中appscale.tools.appscale_tools.AppScaleTools.upgrade方法的典型用法代码示例。如果您正苦于以下问题:Python AppScaleTools.upgrade方法的具体用法?Python AppScaleTools.upgrade怎么用?Python AppScaleTools.upgrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appscale.tools.appscale_tools.AppScaleTools
的用法示例。
在下文中一共展示了AppScaleTools.upgrade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upgrade
# 需要导入模块: from appscale.tools.appscale_tools import AppScaleTools [as 别名]
# 或者: from appscale.tools.appscale_tools.AppScaleTools import upgrade [as 别名]
def upgrade(self):
""" Allows users to upgrade to the latest version of AppScale."""
contents_as_yaml = yaml.safe_load(self.read_appscalefile())
# Construct the appscale-upgrade command from argv and the contents of
# the AppScalefile.
command = []
if 'keyname' in contents_as_yaml:
command.append("--keyname")
command.append(contents_as_yaml['keyname'])
if 'verbose' in contents_as_yaml and contents_as_yaml['verbose'] == True:
command.append("--verbose")
if 'ips_layout' in contents_as_yaml:
command.append('--ips_layout')
command.append(
base64.b64encode(yaml.dump(contents_as_yaml['ips_layout'])))
if 'login' in contents_as_yaml:
command.extend(['--login', contents_as_yaml['login']])
if 'test' in contents_as_yaml and contents_as_yaml['test'] == True:
command.append('--test')
options = ParseArgs(command, 'appscale-upgrade').args
options.ips = yaml.safe_load(base64.b64decode(options.ips_layout))
options.terminate = False
options.clean = False
AppScaleTools.upgrade(options)