'Configure CloudStack tests for use with static configuration.'

def _setup_static(self):

    parser = configparser.RawConfigParser()
    parser.read(self.config_static_path)
    self.endpoint = parser.get('cloudstack', 'endpoint')
    parts = urlparse(self.endpoint)
    self.host = parts.hostname
    if (not self.host):
        raise ApplicationError(('Could    not    determine    host    from    endpoint:    %s' % self.endpoint))
    if parts.port:
        self.port = parts.port
    elif (parts.scheme == 'http'):
        self.port = 80
    elif (parts.scheme == 'https'):
        self.port = 443
    else:
        raise ApplicationError(('Could    not    determine    port    from    endpoint:    %s' % self.endpoint))
    display.info(('Read    cs    host    "%s"    and    port    %d    from    config:    %s' % (self.host, self.port, self.config_static_path)), verbosity=1)
    self._wait_for_service()
