~juju-qa/juju-ci-tools/trunk

« back to all changes in this revision

Viewing changes to jujupy.py

  • Committer: Curtis Hovey
  • Date: 2015-07-13 19:19:20 UTC
  • mfrom: (979.3.8 juju-ci-tools)
  • Revision ID: curtis@canonical.com-20150713191920-tyc230x0vwropkcw
Add first installment of status tests (with correction to Makefile).

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
        return self.get_env_client(environment).get_juju_output(
125
125
            command, *args, **kwargs)
126
126
 
127
 
    def get_status(self, environment, timeout=60):
 
127
    def get_status(self, environment, timeout=60, raw=False, *args):
128
128
        """Get the current status as a dict."""
129
 
        return self.get_env_client(environment).get_status(timeout)
 
129
        return self.get_env_client(environment).get_status(timeout, raw, *args)
130
130
 
131
131
    def get_env_option(self, environment, option):
132
132
        """Return the value of the environment's configured option."""
297
297
                print('!!! ' + e.stderr)
298
298
                raise
299
299
 
300
 
    def get_status(self, timeout=60):
 
300
    def get_status(self, timeout=60, raw=False, *args):
301
301
        """Get the current status as a dict."""
302
302
        for ignored in until_timeout(timeout):
303
303
            try:
 
304
                if raw:
 
305
                    return self.get_juju_output('status', *args)
304
306
                return Status.from_text(self.get_juju_output('status'))
305
307
            except subprocess.CalledProcessError as e:
306
308
                pass
929
931
    def juju(self, command, *args):
930
932
        return self.client.juju(self, command, args)
931
933
 
932
 
    def get_status(self, timeout=60):
933
 
        return self.client.get_status(self, timeout)
 
934
    def get_status(self, timeout=60, raw=False, *args):
 
935
        return self.client.get_status(self, timeout, raw, *args)
934
936
 
935
937
    def wait_for_deploy_started(self, service_count=1, timeout=1200):
936
938
        """Wait until service_count services are 'started'.