~abentley/juju-ci-tools/client-from-config-4

« back to all changes in this revision

Viewing changes to deploy_stack.py

  • Committer: Aaron Bentley
  • Date: 2016-07-05 14:15:26 UTC
  • mfrom: (1468.1.6 client-from-config-3)
  • Revision ID: aaron.bentley@canonical.com-20160705141526-v1gveg82a4swb3fb
Merged client-from-config-3 into client-from-config-4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
701
701
        try:
702
702
            try:
703
703
                if len(self.known_hosts) == 0:
704
 
                    host = get_machine_dns_name(self.client.get_admin_client(),
705
 
                                                '0')
 
704
                    host = get_machine_dns_name(
 
705
                        self.client.get_controller_client(), '0')
706
706
                    if host is None:
707
707
                        raise ValueError('Could not get machine 0 host')
708
708
                    self.known_hosts['0'] = host
743
743
        # be accurate for a model created by create_environment.
744
744
        if not self._should_dump():
745
745
            return
746
 
        admin_client = self.client.get_admin_client()
 
746
        controller_client = self.client.get_controller_client()
747
747
        if not self.jes_enabled:
748
748
            clients = [self.client]
749
749
        else:
751
751
                clients = list(self.client.iter_model_clients())
752
752
            except Exception:
753
753
                # Even if the controller is unreachable, we may still be able
754
 
                # to gather some logs.  admin_client and self.client are all
755
 
                # we have knowledge of.
756
 
                clients = [admin_client]
757
 
                if self.client is not admin_client:
 
754
                # to gather some logs. The controller_client and self.client
 
755
                # instances are all we have knowledge of.
 
756
                clients = [controller_client]
 
757
                if self.client is not controller_client:
758
758
                    clients.append(self.client)
759
759
        for client in clients:
760
 
            if client.env.environment == admin_client.env.environment:
 
760
            if client.env.environment == controller_client.env.environment:
761
761
                known_hosts = self.known_hosts
762
762
                if self.jes_enabled:
763
763
                    runtime_config = self.client.get_cache_path()