~andrewjbeach/juju-ci-tools/get-juju-dict

« back to all changes in this revision

Viewing changes to deploy_stack.py

  • Committer: Aaron Bentley
  • Date: 2016-05-26 17:08:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1434.
  • Revision ID: aaron.bentley@canonical.com-20160526170821-vorjio9gnla043x7
Support FAKE as a juju binary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
479
479
    @classmethod
480
480
    def from_args(cls, args):
481
481
        env = SimpleEnvironment.from_config(args.env)
482
 
        client = EnvJujuClient.by_version(env, args.juju_bin, debug=args.debug)
 
482
        if args.juju_bin == 'FAKE':
 
483
            from tests.test_jujupy import fake_juju_client
 
484
            client = fake_juju_client(env=env)
 
485
        else:
 
486
            client = EnvJujuClient.by_version(env, args.juju_bin,
 
487
                                              debug=args.debug)
483
488
        jes_enabled = client.is_jes_enabled()
484
489
        return cls(
485
490
            args.temp_env_name, client, client, args.bootstrap_host,
669
674
        """Dump logs for all models in the bootstrapped controller."""
670
675
        # This is accurate because we bootstrapped self.client.  It might not
671
676
        # be accurate for a model created by create_environment.
 
677
        from tests.test_jujupy import FakeBackend
 
678
        if isinstance(self.client._backend, FakeBackend):
 
679
            return
672
680
        admin_client = self.client.get_admin_client()
673
681
        if not self.jes_enabled:
674
682
            clients = [self.client]