'Verify that if we are running on Google that our scopes are valid.'

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)] == '/'):
            account = account[0:(-1)]
        result = fetch(os.path.join(GOOGLE_INSTANCE_METADATA_URL, 'service-accounts', os.path.basename(account), 'scopes'), google=True)
        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))
