Changeset 3567 for palm/trunk/SCRIPTS/palm_wd
- Timestamp:
- Nov 27, 2018 1:59:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palm_wd
r2825 r3567 25 25 # ----------------- 26 26 # $Id$ 27 # Adjustments and bugfixes 28 # 29 # 30 # 2825 2018-02-20 21:48:27Z maronga 27 31 # Modified header 28 32 # … … 91 95 92 96 # Determine PALM directories 93 try: 94 devnull = open(os.devnull, 'w') 95 out = sub.check_output("echo $PALM_BIN", shell=True, stderr=sub.STDOUT) 96 palm_bin = out.rstrip() 97 palm_dir = out.split("palm")[0] + "palm/" + out.split("palm")[1].split("/")[1] 98 out = None 99 except: 100 print "Error. $PALM_BIN is not set." 101 raise SystemExit 102 103 104 # Read configuration file 105 # First check if the configuration file exists 106 if ( os.path.exists(palm_dir + '/.wd.config') == False ): 107 print "Error. No configuration file .wd.config found in " + palm_dir 108 raise SystemExit 109 110 config = ConfigParser.RawConfigParser() 111 config.read(palm_dir + '/.wd.config') 97 # Check if configuration files exists and quit otherwise 98 input_config = ".wd.config" 99 for i in range(1,len(sys.argv)): 100 input_config = str(sys.argv[i]) 101 102 config = configparser.RawConfigParser(allow_no_value=True) 103 104 if ( os.path.isfile(input_config) == False ): 105 print ("Error. No configuration file " + input_config + " found.") 106 raise SystemExit 107 else: 108 print(os.path.isfile(input_config)) 109 110 config.read(input_config) 111 112 112 113 113 description = [] 114 114 hostname = [] 115 115 username = [] 116 pycall = [] 116 117 117 118 for i in range(0,len(config.sections())): … … 125 126 hostname.append(config.get(description_tmp, 'hostname')) 126 127 username.append(config.get(description_tmp, 'username')) 128 pycall.append(config.get(description_tmp, 'pycall')) 127 129 else: 128 130 update_frequency = int(config.get(description_tmp, 'update_frequency'))*60000 … … 401 403 # Perform ssh command 402 404 host = username[h] + "@" + hostname[h] 403 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd queue " + username[h]],405 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd queue " + username[h]], 404 406 shell=False, 405 407 stdout=sub.PIPE, … … 692 694 host = username[h] + "@" + hostname[h] 693 695 694 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd cancel " + jobname],696 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd cancel " + jobname], 695 697 shell=False, 696 698 stdout=sub.PIPE, … … 719 721 host = username[h] + "@" + hostname[h] 720 722 721 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd check " + jobname],723 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd check " + jobname], 722 724 shell=False, 723 725 stdout=sub.PIPE, … … 746 748 user = username[h] 747 749 748 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd stop " + jobrealname],750 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd stop " + jobrealname], 749 751 shell=False, 750 752 stdout=sub.PIPE, … … 778 780 user = username[h] 779 781 780 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd restart " + jobrealname],782 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd restart " + jobrealname], 781 783 shell=False, 782 784 stdout=sub.PIPE, … … 810 812 user = username[h] 811 813 812 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd parin " + jobrealname],814 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd parin " + jobrealname], 813 815 shell=False, 814 816 stdout=sub.PIPE, … … 843 845 user = username[h] 844 846 845 ssh = sub.Popen(["ssh", "%s" % host, "/sw/tools/python/2.7.6/generic/bin/pythonpalm_wdd rc " + jobrealname],847 ssh = sub.Popen(["ssh", "%s" % host, pycall[h] + " palm_wdd rc " + jobrealname], 846 848 shell=False, 847 849 stdout=sub.PIPE,
Note: See TracChangeset
for help on using the changeset viewer.