예제 #1
0
def _WarnIfSettingProjectWithNoAccess(scope, project):
    """Warn if setting 'core/project' config to inaccessible project."""

    # Only display a warning if the following conditions are true:
    #
    # * The current scope is USER (not occurring in the context of installation).
    # * The 'core/account' value is set (a user has authed).
    #
    # If the above conditions are met, check that the project being set exists
    # and is accessible to the current user, otherwise show a warning.
    if (scope == properties.Scope.USER
            and properties.VALUES.core.account.Get()):
        project_ref = command_lib_util.ParseProject(project)
        base.DisableUserProjectQuota()
        try:
            projects_api.Get(project_ref)
        except (apitools_exceptions.HttpError,
                c_store.NoCredentialsForAccountException):
            log.warning('You do not appear to have access to project [{}] or'
                        ' it does not exist.'.format(project))
        finally:
            base.EnableUserProjectQuota()
 def Filter(self, context, args):
   """Enables User-Project override for this surface."""
   base.EnableUserProjectQuota()
   # TODO(b/190538573):  Determine if command group works with project number
   base.RequireProjectID(args)
예제 #3
0
 def Filter(self, context, args):
     del context, args
     # Explicitly enables user-project-override as it's disabled at compute
     # level.
     base.EnableUserProjectQuota()
예제 #4
0
 def Filter(self, context, args):
     """Enables User-Project override for this surface."""
     del context, args
     # TODO(b/128363282)
     base.EnableUserProjectQuota()
예제 #5
0
 def Filter(self, context, args):
     """Enables User-Project override for this surface."""
     base.EnableUserProjectQuota()
예제 #6
0
    def Filter(self, context, args):
        del context, args

        # This is technically the default, but some gcloud commands like IAM have
        # user project override off by default, so we enable it here explicitly.
        base.EnableUserProjectQuota()
예제 #7
0
 def Filter(self, context, args):
     base.EnableUserProjectQuota()
예제 #8
0
class Osconfig(base.Group):
  """Manage OS Config tasks for Compute Engine VMs."""
  category = base.TOOLS_CATEGORY
  base.EnableUserProjectQuota()
예제 #9
0
class Budgets(base.Group):
    """Manage the budgets of your billing accounts."""

    base.EnableUserProjectQuota()
예제 #10
0
class Opsagents(base.Group):
    """Manage Operation Suite (Ops) agents for Compute Engine VM instances."""
    base.EnableUserProjectQuota()