parameters: (self)
return_statement: return credential
docstring: Return the credential which is directly tied to the inventory source type.
docstring_summary: Return the credential which is directly tied to the inventory source type.
docstring_tokens: Return the credential which is directly tied to the inventory source type .
function: def get_cloud_credential(self):
          """Return the credential which is directly tied to the inventory source type."""
          credential = None
          for cred in self.credentials.all():
              if self.source in CLOUD_PROVIDERS:
                  if cred.kind == self.source.replace('ec2', 'aws'):
                      credential = cred
                      break
              else:
                  # these need to be returned in the API credential field
                  if cred.credential_type.kind != 'vault':
                      credential = cred
                      break
          return credential
function_tokens: def get_cloud_credential ( self ) : credential = None for cred in self . credentials . all ( ) : if self . source in CLOUD_PROVIDERS : if cred . kind == self . source . replace ( 'ec2' , 'aws' ) : credential = cred break else : # these need to be returned in the API credential field if cred . credential_type . kind != 'vault' : credential = cred break return credential