示例#1
0
    def Run(self, args):
        """Runs the list command."""
        if properties.VALUES.core.disable_usage_reporting.GetBool() in [
                None, True
        ]:
            OptInPrompter().Prompt()
        update_manager = util.GetUpdateManager(args)
        if args.component_ids and not args.version:
            install = console_io.PromptContinue(
                message=
                'You have specified individual components to update.  If you '
                'are trying to install new components, use:\n  $ gcloud '
                'components install {components}'.format(
                    components=' '.join(args.component_ids)),
                prompt_string='Do you want to run install instead',
                default=False,
                throw_if_unattended=False,
                cancel_on_no=False)
            if install:
                update_manager.Install(args.component_ids,
                                       allow_no_backup=args.allow_no_backup)
                return

        update_manager.Update(args.component_ids,
                              allow_no_backup=args.allow_no_backup,
                              version=args.version)
示例#2
0
 def Run(self, args):
     """Runs the list command."""
     self._SetFormat(args)
     update_manager = util.GetUpdateManager(args)
     result = update_manager.List(show_hidden=args.show_hidden,
                                  only_local_state=args.only_local_state)
     (to_print, self._current_version, self._latest_version) = result
     return to_print
示例#3
0
 def Run(self, args):
     manager = util.GetUpdateManager(args)
     if manager.IsPythonBundled():
         python_location = update_manager.CopyPython()
     else:
         python_location = sys.executable
     # There's no straightforward way to print a string that was returned from
     # Run() using the formatting, so we wrap it in a dict.
     return {'python_location': python_location}
示例#4
0
    def Run(self, args):
        """Runs the list command."""
        update_manager = util.GetUpdateManager(args)
        result = update_manager.List(show_hidden=args.show_hidden)
        (to_print, self._current_version, self._latest_version) = result
        if not to_print:
            raise StopIteration

        for c in to_print:
            yield c
        yield resource_printer_base.FinishMarker()
示例#5
0
 def Run(self, args):
     """Runs the list command."""
     update_manager = util.GetUpdateManager(args)
     update_manager.Install(args.component_ids,
                            allow_no_backup=args.allow_no_backup)
示例#6
0
 def Run(self, args):
   """Runs the list command."""
   update_manager = util.GetUpdateManager(args)
   update_manager.Reinstall()