Capture any issue with juju connection
This commit is contained in:
@@ -6,6 +6,7 @@ import logging
|
||||
import sys
|
||||
|
||||
from juju.model import Model
|
||||
from juju.errors import JujuConnectionError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.INFO)
|
||||
@@ -65,7 +66,10 @@ async def main(args):
|
||||
if the_model == "local":
|
||||
await model.connect_current()
|
||||
else:
|
||||
await model.connect(the_model)
|
||||
try:
|
||||
await model.connect(the_model)
|
||||
except JujuConnectionError as e:
|
||||
logger.error(e)
|
||||
|
||||
try:
|
||||
for key, action in actions:
|
||||
|
||||
Reference in New Issue
Block a user