def verify_google_scopes(self):
    if not is_google_instance():
      return

    if not self.verify_true_false('providers.google.enabled'):
      return

    if not self.__bindings.get('providers.google.enabled'):
      return

    result = fetch(
        GOOGLE_INSTANCE_METADATA_URL + '/service-accounts/', google=True)
    service_accounts = result.content if result.ok() else ''

    required_scopes = [GOOGLE_OAUTH_URL + '/compute']
    found_scopes = []

    for account in filter(bool, service_accounts.split('\n')):
      if account[-1] == '/':
        # Strip off trailing '/' so we can take the basename.
        account = account[0:-1]

      result = fetch(
          os.path.join(GOOGLE_INSTANCE_METADATA_URL, 'service-accounts',
                       os.path.basename(account), 'scopes'),
          google=True)

      # cloud-platform scope implies all the other scopes.
      have = str(result.content)
      if have.find('https://www.googleapis.com/auth/cloud-platform') >= 0:
        found_scopes.extend(required_scopes)

      for scope in required_scopes:
        if have.find(scope) >= 0:
          found_scopes.append(scope)

    for scope in required_scopes:
      if not scope in found_scopes:
        self.__errors.append(
            'Missing required scope "{scope}".'.format(scope=scope))
Remove a given address from an VM instance.
dataset/ETHPy150Open spinnaker/spinnaker/pylib/spinnaker/validate_configuration.py/ValidateConfig.verify_google_scopes--crossover with--dataset/ETHPy150Open tmetsch/occi-os/occi_os_api/nova_glue/net.py/remove_floating_ip