- cmd = ['timeout', '-t', JujuEpc.juju_timeout,
- 'juju', 'bootstrap', 'abot-epc', 'abot-controller',
- '--metadata-source', '/root',
- '--constraints', 'mem=2G',
- '--bootstrap-series', 'xenial',
- '--config', 'network={}'.format(net_id),
- '--config', 'ssl-hostname-verification=false',
- '--config', 'use-floating-ip=true',
- '--config', 'use-default-secgroup=true',
- '--debug']
- output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
- self.__logger.info("%s\n%s", " ".join(cmd), output)
+
+ self.__logger.info("Starting Juju Bootstrap process...")
+ try:
+ cmd = ['timeout', '-t', JujuEpc.juju_timeout,
+ 'juju', 'bootstrap', 'abot-epc', 'abot-controller',
+ '--metadata-source', '/root',
+ '--constraints', 'mem=2G',
+ '--bootstrap-series', 'xenial',
+ '--config', 'network={}'.format(net_id),
+ '--config', 'ssl-hostname-verification=false',
+ '--config', 'use-floating-ip=true',
+ '--config', 'use-default-secgroup=true',
+ '--debug']
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ self.__logger.info("%s\n%s", " ".join(cmd), output)
+ except subprocess.CalledProcessError as cpe:
+ self.__logger.error(
+ "Exception with Juju Bootstrap: %s\n%s",
+ cpe.cmd, cpe.output)
+ return False
+ except Exception: # pylint: disable=broad-except
+ self.__logger.exception("Some issue with Juju Bootstrap ...")
+ return False
+