From: garciadeblas Date: Tue, 6 Nov 2018 04:02:45 +0000 (+0100) Subject: OSM_HOSTNAME defaults to 127.0.0.1 instead of None X-Git-Tag: v5.0.0~15 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fosmclient.git;a=commitdiff_plain;h=78e9a1baa7cf3c6da5a1d8c84bb51efad5a09a62 OSM_HOSTNAME defaults to 127.0.0.1 instead of None Change-Id: I8b53c03daf1b244feedd00a3457ef75b907b2e70 Signed-off-by: garciadeblas --- diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index e2e60ae..d1cd349 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -25,6 +25,7 @@ from prettytable import PrettyTable import yaml import json import time +import pycurl def check_client_version(obj, what, version='sol005'): ''' @@ -45,7 +46,7 @@ def check_client_version(obj, what, version='sol005'): @click.group() @click.option('--hostname', - default=None, + default="127.0.0.1", envvar='OSM_HOSTNAME', help='hostname of server. ' + 'Also can set OSM_HOSTNAME in environment') @@ -1567,4 +1568,11 @@ def ns_action(ctx, if __name__ == '__main__': - cli() + try: + cli() + except pycurl.error as e: + print(e) + print('Maybe "--hostname" option or OSM_HOSTNAME' + + 'environment variable needs to be specified') + exit(1) +