Uploaded image for project: 'DC/OS'
  1. DC/OS
  2. DCOS_OSS-3862

DC/OS Test Utils - DcosApiSession.get_args_from_env assumes agents env var not set if there are no agents

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: DC/OS 1.13.0
    • Component/s: testing
    • Labels:
      None

      Description

      Use case:

      • User wants to run a DC/OS integration test which requires just a master node
      • User creates a cluster with just a master node
      • User sets the MASTER_HOSTS, SLAVE_HOSTS, PUBLIC_SLAVE_HOSTS environment variables.
      • User sees:
      Exception: This cluster is set to wait for hosts, however, not all host lists were supplied. Please set all three environment variables of MASTER_HOSTS, SLAVE_HOSTS, and PUBLIC_SLAVE_HOSTS to the appropriate cluster IPs (comma separated). Alternatively, set WAIT_FOR_HOSTS=false in the environment to use whichever hosts are currently registered.
      

      I believe that the error is in the following code:

              masters = os.getenv('MASTER_HOSTS')
              slaves = os.getenv('SLAVE_HOSTS')
              public_slaves = os.getenv('PUBLIC_SLAVE_HOSTS')
              return {
                  'auth_user': auth_user,
                  'dcos_url': os.getenv('DCOS_DNS_ADDRESS', 'http://leader.mesos'),
                  'masters': masters.split(',') if masters else None,
                  'slaves': slaves.split(',') if slaves else None,
                  'public_slaves': public_slaves.split(',') if public_slaves else None}
      

      For each of the keys which refer to roles, e.g. slaves, if slaves is falsy if os.environ['SLAVE_HOSTS'] == ''.

      Instead, the logic could be slaves.split(',') if slaves is not None else None.

        Attachments

          Activity

            People

            • Assignee:
              adamdangoor Adam Dangoor
              Reporter:
              adamdangoor Adam Dangoor
              Team:
              Dev Prod Team
              Watchers:
              Adam Dangoor, Charles Provencher, Jan-Philip Gehrcke, Mergebot, Senthil Kumaran
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: