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

« back to all changes in this revision

Viewing changes to jujupy/fake.py

  • Committer: Christopher Lee
  • Date: 2017-04-05 23:07:51 UTC
  • mfrom: (1938.3.28 timing_bootstrap)
  • Revision ID: chris.lee@canonical.com-20170405230751-pj0l3y2anyczvcb5
Merge the CommandTiming and CommandComplete work for timing commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    JujuData,
36
36
    SoftDeadlineExceeded,
37
37
)
 
38
from jujupy.client import CommandTime
38
39
 
39
40
__metaclass__ = type
40
41
 
939
940
                num = int(parsed.n or 1)
940
941
                self.deploy(model_state, parsed.charm_name, num,
941
942
                            parsed.service_name, parsed.series)
 
943
                return (0, CommandTime(command, args))
942
944
            if command == 'remove-application':
943
945
                model_state.destroy_service(*args)
944
946
            if command == 'add-relation':
987
989
                self.controller_state.destroy()
988
990
            if command == 'kill-controller':
989
991
                if self.controller_state.state == 'not-bootstrapped':
990
 
                    return
 
992
                    return (0, CommandTime(command, args))
991
993
                self.controller_state.destroy(kill=True)
 
994
                return (0, CommandTime(command, args))
992
995
            if command == 'destroy-model':
993
996
                if not self.is_feature_enabled('jes'):
994
997
                    raise JESNotSupported()
1039
1042
                    self.controller_state.shares.remove(username)
1040
1043
            if command == 'restore-backup':
1041
1044
                model_state.restore_backup()
 
1045
            return 0, CommandTime(command, args)
1042
1046
 
1043
1047
    @contextmanager
1044
1048
    def juju_async(self, command, args, used_feature_flags,