Ejemplo n.º 1
0
 def ParameterInfo(self, parsed_args, argument):
     return parameter_info_lib.ParameterInfoByConvention(
         parsed_args,
         argument,
         self.collection,
         updaters=COMPLETERS_BY_CONVENTION,
     )
Ejemplo n.º 2
0
 def ParameterInfo(self, parsed_args, argument):
   return parameter_info_lib.ParameterInfoByConvention(
       parsed_args,
       argument,
       self.collection,
       updaters={
           'project': (resource_manager_completers.ProjectCompleter, True),
       },
   )
    def ParameterInfo(self, parsed_args, argument):
        """Returns the parameter info object.

    Args:
      parsed_args: The command line parsed args object.
      argument: The argparse argument object attached to this completer.

    Returns:
      The parameter info object.
    """
        return parameter_info_lib.ParameterInfoByConvention(
            parsed_args, argument)
Ejemplo n.º 4
0
 def SetUp(self):
     properties.VALUES.core.project.Set('myxproject')
     self.parsed_args = core_completer_test_base.MockNamespace(
         args={
             'instance':
             'my_z_instance',  # positional, no flag representation
             '--project': None,  # properties fallback
             '--undefined': None,  # flag not specified
             '--zone': 'zone-1',  # flag specified
         }, )
     self.parameter_info = parameter_info_lib.ParameterInfoByConvention(
         self.parsed_args,
         MockArgument('instance'),
         collection='test.resource',
     )
Ejemplo n.º 5
0
    def ParameterInfo(self, parsed_args, argument):
        """Returns the parameter info object.

    This is the default method that returns the parameter info by name
    convention object.  Resource argument completers should override this
    method to provide the exact object, not the "best guess" of the default.

    Args:
      parsed_args: The command line parsed args object.
      argument: The argparse argument object attached to this completer.

    Returns:
      The parameter info object.
    """
        return parameter_info_lib.ParameterInfoByConvention(
            parsed_args, argument, self.api)