Beispiel #1
0
  def __init__(self, project, zone, service_account=None,
               ssh_passphrase_file='', trace=True):
    """Construct instance.

    Args:
      project: The name of the GCP project this agent will run against.
      zone: The default GCP zone this agent will interact with.
      service_account: If provided, the GCP service account that the agent
          should authenticate with. This must have already been activated
          with the local gcloud using gcloud auth activate-service-account.
          If no account is provided, the configured default account will be
          used. To change the default account, use gcloud config set account.
      ssh_passphrase_file: The path to a file that contains the SSH passphrase.
          This is optional, but if provided then it allows the agent to log
          into instances if needed in order to tunnel through firewalls to
          gain access to test internal subsystems or execute remote commands.
          You can run ssh-agent as an alternative.
          The file should be made user read-only (400) for security.
      trace: Whether to trace all the calls by default for debugging.
    """
    super(GCloudAgent, self).__init__('gcloud', output_scrubber=JsonScrubber())
    self.__project = project
    self.__zone = zone
    self.__ssh_passphrase_file = ssh_passphrase_file
    self.__service_account = service_account
    self.trace = trace
    self.logger = logging.getLogger(__name__)
Beispiel #2
0
    def __init__(self, logger=None):
        """Construct instance.

    Args:
      logger: The logger to inject if other than the default.
    """
        logger = logger or logging.getLogger(__name__)
        super(KubeCtlAgent, self).__init__('kubectl',
                                           output_scrubber=JsonScrubber(),
                                           logger=logger)
Beispiel #3
0
    def __init__(self, trace=True):
        """Construct instance.

    Args:
      trace: Whether to trace all the calls by default for debugging.
    """
        super(DcosCliAgent, self).__init__('dcos',
                                           output_scrubber=JsonScrubber())
        self.trace = trace
        self.logger = logging.getLogger(__name__)