Print instructions to set OSM_HOSTNAME in case of NotFound exception
Change-Id: I42c6a82419355c44c20fd251638c215a8c340eb1
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py
index 5d33183..2976e19 100755
--- a/osmclient/scripts/osm.py
+++ b/osmclient/scripts/osm.py
@@ -15,7 +15,7 @@
import click
from osmclient import client
-from osmclient.common.exceptions import ClientException
+from osmclient.common.exceptions import ClientException, NotFound
from osmclient.cli_commands import (
alarms,
app_profile,
@@ -367,11 +367,13 @@
print(
'Maybe "--hostname" option or OSM_HOSTNAME environment variable needs to be specified'
)
- except ClientException as exc:
- print("ERROR: {}".format(exc))
+ except NotFound as exc:
+ print("NOT FOUND: {}".format(exc))
print(
'Maybe "--hostname" option or OSM_HOSTNAME environment variable needs to be specified'
)
+ except ClientException as exc:
+ print("ERROR: {}".format(exc))
except (FileNotFoundError, PermissionError) as exc:
print("Cannot open file: {}".format(exc))
except yaml.YAMLError as exc: