From: garciadeblas Date: Fri, 21 Mar 2025 13:51:05 +0000 (+0100) Subject: Print instructions to set OSM_HOSTNAME in case of NotFound exception X-Git-Tag: v18.0.0~9 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=ca7ebd82ef4d111a4c6427a7962ca78e189c1612;p=osm%2Fosmclient.git Print instructions to set OSM_HOSTNAME in case of NotFound exception Change-Id: I42c6a82419355c44c20fd251638c215a8c340eb1 Signed-off-by: garciadeblas --- 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 @@ def cli(): 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: