#!/usr/bin/env python3 import sys import xmlrpc.client as client import ssl context=ssl._create_unverified_context() import os if len(sys.argv)>1: try: os.mkdir(sys.argv[1]+"n4d-vars") f=open(sys.argv[1]+"n4d-vars/vars","w") try: c=client.ServerProxy("https://localhost:9779",context=context,allow_none=True) vars=c.get_variables("","VariablesManager") for var in vars: f.write(str(var)+"\n") for key in vars[var]: f.write("\t"+str(key)+"="+str(vars[var][key])+"\n") except Exception as e: f.write(str(e)+"\n") f.close() os.mkdir(sys.argv[1]+ "n4d-vars/varsfiles") os.system("cp -r /var/lib/n4d/ " + sys.argv[1]+ "n4d-vars/varsfiles/") except: pass