예제 #1
0
# Process the sorted SLURM configuration dictionary

date_fields = [ 'boot_time', 'last_update' ]
for key in sorted(ctl_dict.iterkeys()):

	if key in date_fields:

		if ctl_dict[key] == 0:
			print "\t%-35s : N/A" % (key)
		else:
			ddate = pyslurm.epoch2date(ctl_dict[key])
			print "\t%-35s : %s" % (key, ddate)

	elif 'debug_flags' in key:
		print "\t%-35s : %s" % (key, pyslurm.get_debug_flags(ctl_dict[key]))
	else:
		if 'key_pairs' not in key:
			print "\t%-35s : %s" % (key, ctl_dict[key])

if ctl_dict.has_key('key_pairs'):

	print ""
	print "Additional Information :"
	print "------------------------"
	print ""

	for key in sorted(ctl_dict['key_pairs'].iterkeys()):
		print "\t%-35s : %s" % (key, ctl_dict['key_pairs'][key])

#print a.key_pairs()
예제 #2
0
# Process the sorted Slurm configuration dictionary

date_fields = ['boot_time', 'last_update']
for key in sorted(ctl_dict.items()):

    if key in date_fields:

        if ctl_dict[key] == 0:
            print("\t{0:<35} : N/A".format(key))
        else:
            ddate = pyslurm.epoch2date(ctl_dict[key])
            print("\t{0:<35} : {1}".format(key, ddate))

    elif 'debug_flags' in key:
        print("\t{0:<35s} : {1}".format(key[0],
                                        pyslurm.get_debug_flags(key[1])))
    else:
        if 'key_pairs' not in key:
            print("\t{0:<35} : {1}".format(key[0], key[1]))

if "key_pairs" in ctl_dict:

    print()
    print("Additional Information :")
    print("------------------------")
    print()

    for key in sorted(ctl_dict['key_pairs'].items()):
        print("\t{0:<35} : {1}".format(key, ctl_dict['key_pairs'][key]))
예제 #3
0
import pyslurm

try:
    a = pyslurm.config()
    ctl_dict = a.get()
except ValueError as value_error:
    print("Error - {0}".format(value_error.args[0]))
    sys.exit(1)

date_fields = ["boot_time", "last_update"]
for key in sorted(ctl_dict.items()):

    if key in date_fields:

        if ctl_dict[key] == 0:
            print("\t{0:<35} : N/A".format(key))
        else:
            ddate = pyslurm.epoch2date(ctl_dict[key])
            print("\t{0:<35} : {1}".format(key, ddate))

    elif "debug_flags" in key:
        print("\t{0:<35s} : {1}".format(key[0], pyslurm.get_debug_flags(key[1])))
    else:
        if "key_pairs" not in key:
            print("\t{0:<35} : {1}".format(key[0], key[1]))

if "key_pairs" in ctl_dict:
    print("\nAdditional Information :\n------------------------\n")
    for key in sorted(ctl_dict["key_pairs"].items()):
        print("\t{0:<35} : {1}".format(key, ctl_dict["key_pairs"][key]))
예제 #4
0
파일: slurm_ctl.py 프로젝트: qytz/pyslurm
    sys.exit(-1)

# Process the sorted Slurm configuration dictionary

date_fields = ["boot_time", "last_update"]
for key in sorted(ctl_dict.iterkeys()):

    if key in date_fields:

        if ctl_dict[key] == 0:
            print("\t{0:<35} : N/A".format(key))
        else:
            ddate = pyslurm.epoch2date(ctl_dict[key])
            print("\t{0:<35} : {1}".format(key, ddate))

    elif "debug_flags" in key:
        print("\t{0:<35s} : {1}".format(key, pyslurm.get_debug_flags(ctl_dict[key])))
    else:
        if "key_pairs" not in key:
            print("\t{0:<35} : {1}".format(key, ctl_dict[key]))

if ctl_dict.has_key("key_pairs"):

    print()
    print("Additional Information :")
    print("------------------------")
    print()

    for key in sorted(ctl_dict["key_pairs"].iterkeys()):
        print("\t{0:<35} : {1}".format(key, ctl_dict["key_pairs"][key]))
예제 #5
0
    sys.exit(-1)

# Process the sorted Slurm configuration dictionary

date_fields = [ 'boot_time', 'last_update' ]
for key in sorted(ctl_dict.iterkeys()):

    if key in date_fields:

        if ctl_dict[key] == 0:
            print("\t{0:<35} : N/A".format(key))
        else:
            ddate = pyslurm.epoch2date(ctl_dict[key])
            print("\t{0:<35} : {1}".format(key, ddate))

    elif 'debug_flags' in key:
        print("\t{0:<35s} : {1}".format(key, pyslurm.get_debug_flags(ctl_dict[key])))
    else:
        if 'key_pairs' not in key:
            print("\t{0:<35} : {1}".format(key, ctl_dict[key]))

if ctl_dict.has_key('key_pairs'):

    print()
    print("Additional Information :")
    print("------------------------")
    print()

    for key in sorted(ctl_dict['key_pairs'].iterkeys()):
        print("\t{0:<35} : {1}".format(key, ctl_dict['key_pairs'][key]))
예제 #6
0
    sys.exit(-1)

# Process the sorted Slurm configuration dictionary

date_fields = [ 'boot_time', 'last_update' ]
for key in sorted(ctl_dict.items()):

    if key in date_fields:

        if ctl_dict[key] == 0:
            print("\t{0:<35} : N/A".format(key))
        else:
            ddate = pyslurm.epoch2date(ctl_dict[key])
            print("\t{0:<35} : {1}".format(key, ddate))

    elif 'debug_flags' in key:
        print("\t{0:<35s} : {1}".format(key[0], pyslurm.get_debug_flags(key[1])))
    else:
        if 'key_pairs' not in key:
            print("\t{0:<35} : {1}".format(key[0], key[1]))

if "key_pairs" in ctl_dict:

    print()
    print("Additional Information :")
    print("------------------------")
    print()

    for key in sorted(ctl_dict['key_pairs'].items()):
        print("\t{0:<35} : {1}".format(key, ctl_dict['key_pairs'][key]))
예제 #7
0
# Process the sorted SLURM configuration dictionary

date_fields = ['boot_time', 'last_update']
for key in sorted(ctl_dict.iterkeys()):

    if key in date_fields:

        if ctl_dict[key] == 0:
            print "\t%-35s : N/A" % (key)
        else:
            ddate = pyslurm.epoch2date(ctl_dict[key])
            print "\t%-35s : %s" % (key, ddate)

    elif 'debug_flags' in key:
        print "\t%-35s : %s" % (key, pyslurm.get_debug_flags(ctl_dict[key]))
    else:
        if 'key_pairs' not in key:
            print "\t%-35s : %s" % (key, ctl_dict[key])

if ctl_dict.has_key('key_pairs'):

    print ""
    print "Additional Information :"
    print "------------------------"
    print ""

    for key in sorted(ctl_dict['key_pairs'].iterkeys()):
        print "\t%-35s : %s" % (key, ctl_dict['key_pairs'][key])

#print a.key_pairs()