Exemplo n.º 1
0
    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))
        AppScaleTools.upgrade(options)
Exemplo n.º 2
0
  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))
    AppScaleTools.upgrade(options)