|
@@ -85,16 +85,20 @@ def entry():
|
|
|
|
|
|
|
|
if len(sys.argv) > 1:
|
|
if len(sys.argv) > 1:
|
|
|
subcommand = sys.argv[1]
|
|
subcommand = sys.argv[1]
|
|
|
- parser = CommandParser(None, usage="%(prog)s subcommand [options] [args]", add_help=False)
|
|
|
|
|
|
|
+ if sys.version_info[0] < 3:
|
|
|
|
|
+ args = [None]
|
|
|
|
|
+ else:
|
|
|
|
|
+ args = []
|
|
|
|
|
+ parser = CommandParser(*args, usage="%(prog)s subcommand [options] [args]", add_help=False)
|
|
|
parser.parse_known_args(sys.argv[2:])
|
|
parser.parse_known_args(sys.argv[2:])
|
|
|
|
|
|
|
|
if len(sys.argv) > 1:
|
|
if len(sys.argv) > 1:
|
|
|
prof_id = subcommand = sys.argv[1]
|
|
prof_id = subcommand = sys.argv[1]
|
|
|
#Check if this is a CM managed cluster
|
|
#Check if this is a CM managed cluster
|
|
|
if os.path.isfile(cm_config_file) and not cm_managed and not skip_reload:
|
|
if os.path.isfile(cm_config_file) and not cm_managed and not skip_reload:
|
|
|
- print("ALERT: This appears to be a CM Managed environment")
|
|
|
|
|
- print("ALERT: HUE_CONF_DIR must be set when running hue commands in CM Managed environment")
|
|
|
|
|
- print("ALERT: Please run 'hue <command> --cm-managed'")
|
|
|
|
|
|
|
+ print("ALERT: This appears to be a CM Managed environment")
|
|
|
|
|
+ print("ALERT: HUE_CONF_DIR must be set when running hue commands in CM Managed environment")
|
|
|
|
|
+ print("ALERT: Please run 'hue <command> --cm-managed'")
|
|
|
else:
|
|
else:
|
|
|
prof_id = str(os.getpid())
|
|
prof_id = str(os.getpid())
|
|
|
|
|
|