From 7948a8a4c123c2fcced21b7cd7ff2df173ab21c4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 09:54:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- build/ReleaseManager/ReleaseManagerLib.py | 3 +- creation/lib/cWDictFile.py | 2 +- creation/lib/cgWDictFile.py | 2 + creation/lib/cgWParamDict.py | 4 +- creation/lib/cgWParams.py | 1 + creation/lib/cvWCreate.py | 2 +- creation/lib/cvWDictFile.py | 2 + creation/lib/cvWParamDict.py | 4 +- creation/lib/cvWParams.py | 1 + creation/web_base/factoryCompletedStats.html | 22 +- creation/web_base/factoryEntryStatusNow.html | 108 +++++----- creation/web_base/factoryLogStatus.html | 14 +- creation/web_base/factoryRRDBrowse.html | 6 +- creation/web_base/factoryRRDEntryMatrix.html | 8 +- creation/web_base/factoryStatus.html | 14 +- creation/web_base/factoryStatusNow.html | 196 +++++++++--------- creation/web_base/factory_support.js | 10 +- .../web_base/frontendGroupGraphStatusNow.html | 58 +++--- creation/web_base/frontendRRDGroupMatrix.html | 2 +- creation/web_base/frontendStatus.html | 12 +- creation/web_base/frontendStatusNow.html | 4 +- creation/web_base/frontend_support.js | 10 +- factory/glideFactory.py | 1 - factory/glideFactoryConfig.py | 1 + factory/glideFactoryDowntimeLib.py | 1 + factory/glideFactoryEntry.py | 3 +- factory/glideFactoryEntryGroup.py | 1 - factory/glideFactoryInterface.py | 15 +- factory/glideFactoryLib.py | 11 +- factory/glideFactoryMonitorAggregator.py | 1 - factory/glideFactoryMonitoring.py | 6 +- factory/manageFactoryDowntimes.py | 1 - factory/tools/analyze_entries | 7 - factory/tools/analyze_frontends | 5 - factory/tools/analyze_queues | 5 - factory/tools/cat_logs.py | 1 + factory/tools/find_StartdLogs.py | 1 + factory/tools/find_logs.py | 1 + factory/tools/lib/analyze.py | 1 - frontend/glideinFrontend.py | 3 +- frontend/glideinFrontendConfig.py | 2 + frontend/glideinFrontendDowntimeLib.py | 3 +- frontend/glideinFrontendElement.py | 3 - frontend/glideinFrontendInterface.py | 5 +- frontend/glideinFrontendLib.py | 2 +- frontend/glideinFrontendMonitoring.py | 1 + frontend/tools/glidein_off | 1 + lib/condorMonitor.py | 3 + lib/config_util.py | 2 +- lib/fork.py | 1 - lib/pidSupport.py | 2 + lib/timeConversion.py | 1 + lib/xmlParse.py | 1 - tools/lib/glideinCmd.py | 2 +- ...creation_lib_cWDictFile_DictFileTwoKeys.py | 1 - unittests/test_creation_lib_cgWDictFile.py | 1 + unittests/test_creation_lib_cvWCreate.py | 1 - unittests/test_factory_glideFactoryLib.py | 1 - unittests/test_frontend.py | 1 - unittests/test_lib_xmlParse.py | 2 - 60 files changed, 283 insertions(+), 303 deletions(-) diff --git a/build/ReleaseManager/ReleaseManagerLib.py b/build/ReleaseManager/ReleaseManagerLib.py index 4beca2b32..2ba0aa86f 100644 --- a/build/ReleaseManager/ReleaseManagerLib.py +++ b/build/ReleaseManager/ReleaseManagerLib.py @@ -301,7 +301,7 @@ def __init__(self, rel, python_version, use_mock=True): "_binary_filedigest_algorithm": "md5", #'global __python': '%%{__python2}', #'py_byte_compile': '', - #%py_byte_compile %{__python2} %{buildroot}%{_datadir}/mypackage/foo + # %py_byte_compile %{__python2} %{buildroot}%{_datadir}/mypackage/foo } # __init__ @@ -394,7 +394,6 @@ def execute(self): class PackageExcludes: def __init__(self): - self.commonPattern = [ "CVS", ".DS_Store", diff --git a/creation/lib/cWDictFile.py b/creation/lib/cWDictFile.py index 80159e923..6fea75d2b 100644 --- a/creation/lib/cWDictFile.py +++ b/creation/lib/cWDictFile.py @@ -1769,6 +1769,7 @@ def __init__(self, monitor_dir, work_dir, work_subdir="monitor", monitordir_name # ################################################ + # helper class, used below class fileCommonDicts: def __init__(self): @@ -2235,7 +2236,6 @@ def erase(self, destroy_old_subs=True): # if false, the sub names will be prese return def load(self, destroy_old_subs=True): # if false, overwrite the subs you load, but leave the others as they are - self.main_dicts.load() if destroy_old_subs: self.sub_list = [] diff --git a/creation/lib/cgWDictFile.py b/creation/lib/cgWDictFile.py index 5597f0389..84cf511d5 100644 --- a/creation/lib/cgWDictFile.py +++ b/creation/lib/cgWDictFile.py @@ -208,6 +208,7 @@ def is_equal( # ################################################ + # internal, do not use from outside the module def get_common_dicts(submit_dir, stage_dir): common_dicts = { @@ -266,6 +267,7 @@ def get_entry_dicts(entry_submit_dir, entry_stage_dir, entry_name): # ################################################ + # internal, do not use from outside the module def load_common_dicts(dicts, description_el): # update in place # first submit dir ones (mutable) diff --git a/creation/lib/cgWParamDict.py b/creation/lib/cgWParamDict.py index 8a7113b49..fa6887843 100644 --- a/creation/lib/cgWParamDict.py +++ b/creation/lib/cgWParamDict.py @@ -908,7 +908,7 @@ def sortit(self, unsorted_dict): i = i + 1 temp_list = sorted((x[1][1], x[0]) for x in list(d.items())) sortedList = [] - for (tmp, key) in temp_list: + for tmp, key in temp_list: sortedList.append(d[key][0]) return sortedList @@ -927,6 +927,7 @@ def new_SubDicts(self, sub_name): # ############################################################ + ############################################# # Add a user file residing in the stage area # file as described by Params.file_defaults @@ -1099,7 +1100,6 @@ def iter_to_dict(dictObject): def populate_factory_descript( work_dir, glidein_dict, active_sub_list, disabled_sub_list, conf # will be modified # will be modified ): - down_fname = os.path.join(work_dir, "glideinWMS.downtimes") sec_el = conf.get_child("security") diff --git a/creation/lib/cgWParams.py b/creation/lib/cgWParams.py index c45c98c98..e3a6fb0bf 100644 --- a/creation/lib/cgWParams.py +++ b/creation/lib/cgWParams.py @@ -581,6 +581,7 @@ def get_xml_format(self): # ############################################################ + ##################################### # try to find out the base condor dir def find_condor_base_dir(): diff --git a/creation/lib/cvWCreate.py b/creation/lib/cvWCreate.py index 055b9c33a..f88353830 100644 --- a/creation/lib/cvWCreate.py +++ b/creation/lib/cvWCreate.py @@ -62,7 +62,7 @@ def create_client_mapfile(mapfile_fname, my_DN, factory_DNs, schedd_DNs, collect with open(mapfile_fname, "w") as fd: if my_DN: fd.write('GSI "^{}$" {}\n'.format(re.escape(my_DN), "me")) - for (uid, dns) in ( + for uid, dns in ( ("factory", factory_DNs), ("schedd", schedd_DNs), ("collector", collector_DNs), diff --git a/creation/lib/cvWDictFile.py b/creation/lib/cvWDictFile.py index c1c2c950e..46d744e60 100644 --- a/creation/lib/cvWDictFile.py +++ b/creation/lib/cvWDictFile.py @@ -81,6 +81,7 @@ def parse_val(self, line): # ################################################ + # internal, do not use from outside the module def get_common_dicts(work_dir, stage_dir, simple_work_dir): # if True, do not create params common_dicts = { @@ -148,6 +149,7 @@ def get_group_dicts(group_work_dir, group_stage_dir, group_name, simple_work_dir # ################################################ + # internal, do not use from outside the module def load_common_dicts(dicts, description_el): # update in place # first work dir ones (mutable) diff --git a/creation/lib/cvWParamDict.py b/creation/lib/cvWParamDict.py index 0dedd3f0e..e990e8f5a 100644 --- a/creation/lib/cvWParamDict.py +++ b/creation/lib/cvWParamDict.py @@ -763,6 +763,7 @@ def new_SubDicts(self, sub_name): # ############################################################ + ####################### # Register an attribute # attr_obj as described by Params.attr_defaults @@ -833,7 +834,6 @@ def add_attr_unparsed_real(attr_name, params, dicts): ################################### # Create the frontend descript file def populate_frontend_descript(work_dir, frontend_dict, active_sub_list, params): # will be modified - frontend_dict.add("DowntimesFile", params.downtimes_file) frontend_dict.add("FrontendName", params.frontend_name) frontend_dict.add("WebURL", params.web_url) @@ -891,7 +891,6 @@ def populate_frontend_descript(work_dir, frontend_dict, active_sub_list, params) ####################### # Populate group descript def populate_group_descript(work_dir, group_descript_dict, sub_name, sub_params): # will be modified - group_descript_dict.add("GroupName", sub_name) group_descript_dict.add("MapFile", os.path.join(work_dir, cvWConsts.GROUP_MAP_FILE)) @@ -923,7 +922,6 @@ def populate_group_descript(work_dir, group_descript_dict, sub_name, sub_params) def apply_group_singularity_policy(descript_dict, sub_params, params): - glidein_singularity_use = None query_expr = descript_dict["FactoryQueryExpr"] match_expr = descript_dict["MatchExpr"] diff --git a/creation/lib/cvWParams.py b/creation/lib/cvWParams.py index 009dcc30f..0569f352b 100644 --- a/creation/lib/cvWParams.py +++ b/creation/lib/cvWParams.py @@ -796,6 +796,7 @@ def update_match_attrs(self): # Use the class method instead #################################################################### + # return attribute value in the proper python format def extract_attr_val(attr_obj): if not attr_obj.type in ("string", "int", "expr"): diff --git a/creation/web_base/factoryCompletedStats.html b/creation/web_base/factoryCompletedStats.html index ad7cad23b..f01fd1c45 100644 --- a/creation/web_base/factoryCompletedStats.html +++ b/creation/web_base/factoryCompletedStats.html @@ -179,7 +179,7 @@ "aggwsum", "aggavgf", "affwsumf", - "fail" + "fail", ); var ENTRY; @@ -224,7 +224,7 @@ for (var entry in entries) { if (ec_added < groups_starting_idx) { entries_select.appendChild( - new Option(entries[entry], entries[entry]) + new Option(entries[entry], entries[entry]), ); ec_added++; } else { @@ -254,7 +254,7 @@ fes.appendChild(new Option("total", "total")); for (var frontend in frontend_list[entry]) { frontends_select.appendChild( - new Option(frontend_list[entry][frontend]) + new Option(frontend_list[entry][frontend]), ); } } @@ -831,7 +831,7 @@ for (var i = 0; i < gtype_filtered_list.length; i++) { rrd_filtered_data = new RRDFilterDS( rrd_data1, - gtype_DSs[gtype_filtered_list[i]] + gtype_DSs[gtype_filtered_list[i]], ); var DS_list = []; for (var j = 0; j < rrd_filtered_data.getNrDSs(); j++) { @@ -849,7 +849,7 @@ rrd_data1, null, gtype_formats[gtype_id], - null + null, ); } else if (gtype_id == "fail") { var DS_list = []; @@ -872,8 +872,8 @@ op_list.push( new FractionDS( rrd_data1.getDS(failed_idx).getName(), - rrd_data1.getDS(glidein_idx).getName() - ) + rrd_data1.getDS(glidein_idx).getName(), + ), ); rrd_data1 = new RRDFilterOp(rrd_data1, op_list); var f = new rrdFlot( @@ -881,7 +881,7 @@ rrd_data1, null, gtype_formats[gtype_id], - null + null, ); } //Non-Aggregated InfoGroups @@ -903,12 +903,12 @@ continue; } op_list.push( - new RelativeDS(DS_list, rrd_data1.getDS(i).getName(), i) + new RelativeDS(DS_list, rrd_data1.getDS(i).getName(), i), ); } if (flag == 1) { op_list.push( - new RelativeDS(DS_list, rrd_data1.getDS(0).getName(), 0) + new RelativeDS(DS_list, rrd_data1.getDS(0).getName(), 0), ); } @@ -950,7 +950,7 @@ rrd_data1, null, gtype_formats[gtype_id], - { num_cb_rows: x } + { num_cb_rows: x }, ); } diff --git a/creation/web_base/factoryEntryStatusNow.html b/creation/web_base/factoryEntryStatusNow.html index 549d88f92..eba6f72f0 100644 --- a/creation/web_base/factoryEntryStatusNow.html +++ b/creation/web_base/factoryEntryStatusNow.html @@ -72,7 +72,7 @@ "ClientJobsIdle", "ClientGlideTotal", "ClientCoresTotal", - "ClientInfoAge" + "ClientInfoAge", ); var xmlAttStatusArry = new Array( @@ -83,7 +83,7 @@ "StageIn", "StageOut", "IdleOther", - "Held" + "Held", ); var xmlAttReqArry = new Array("MaxGlideins", "Idle"); var xmlAttCMArry = new Array( @@ -96,7 +96,7 @@ "JobsIdle", "GlideTotal", "CoresTotal", - "InfoAge" + "InfoAge", ); var xmlAttStatNumArry = new Array(); var xmlAttReqNumArry = new Array(); @@ -123,7 +123,7 @@ "cmGlideinIdle", "cmGlideinJobsIdle", "cmGlideinTotal", - "cmGlideinInfoAge" + "cmGlideinInfoAge", ); var exactCols = new Array( @@ -145,7 +145,7 @@ "Registered", "Info age", "Diff(Status: Running - CM: Registered)", - "Diff(Status: Idle - Requested: Idle)" + "Diff(Status: Idle - Requested: Idle)", ); var prTxtArry = new Array("Now", "2 hours", "24 hours", "7 days"); @@ -171,7 +171,7 @@ "Status: Stage out", "Status: Unknown", "Status: Held", - "Client Monitor: Info age" + "Client Monitor: Info age", ); var indivTableAttColors = new Array( 0, @@ -192,7 +192,7 @@ 0, 0, 0, - 2 + 2, ); var indivAtts = new Array( @@ -214,7 +214,7 @@ 5, 6, 7, - 16 + 16, ); var indivChild; @@ -315,10 +315,10 @@ .attributes[0].value ) { feArryMaster.push( - totalEntries[optionIndex].childNodes[feChild].childNodes[x] + totalEntries[optionIndex].childNodes[feChild].childNodes[x], ); feArryPMaster.push( - totalEntriesP[optionIndex].childNodes[3].childNodes[x] + totalEntriesP[optionIndex].childNodes[3].childNodes[x], ); } } @@ -342,7 +342,7 @@ xmlhttp.responseXML.documentElement.getElementsByTagName("total"); frontEndsP = xmlhttp.responseXML.documentElement.getElementsByTagName( - "frontend" + "frontend", ); totalEntriesP = xmlhttp.responseXML.documentElement.getElementsByTagName("entry"); @@ -446,8 +446,8 @@ cellsD[count].appendChild( document.createTextNode( entryAttDescript[optionIndex].childNodes[1].attributes[i - 1] - .name - ) + .name, + ), ); cellsD[count].style.fontWeight = "bold"; rowsD[i].appendChild(cellsD[count]); @@ -456,8 +456,8 @@ cellsD[count].appendChild( document.createTextNode( entryAttDescript[optionIndex].childNodes[1].attributes[i - 1] - .value - ) + .value, + ), ); rowsD[i].appendChild(cellsD[count]); count++; @@ -483,8 +483,8 @@ cellsT[count2].appendChild( document.createTextNode( entryAttDescript[optionIndex].childNodes[3].attributes[i - 1] - .name - ) + .name, + ), ); cellsT[count2].style.fontWeight = "bold"; rowsD[i].appendChild(cellsT[count2]); @@ -493,8 +493,8 @@ cellsT[count2].appendChild( document.createTextNode( entryAttDescript[optionIndex].childNodes[3].attributes[i - 1] - .value - ) + .value, + ), ); rowsD[i].appendChild(cellsT[count2]); count2++; @@ -528,7 +528,7 @@ if (xmlhttp.readyState == 4) { updated = xmlhttp.responseXML.documentElement.getElementsByTagName( - "updated" + "updated", ); totalEntriesMaster = xmlhttp.responseXML.documentElement.getElementsByTagName("entry"); @@ -536,7 +536,7 @@ xmlhttp.responseXML.documentElement.getElementsByTagName("total"); frontEnds = xmlhttp.responseXML.documentElement.getElementsByTagName( - "frontend" + "frontend", ); totalEntries = xmlhttp.responseXML.documentElement.getElementsByTagName("entry"); @@ -760,7 +760,7 @@ totStatChild, totStatChild, totStatChild, - totCMChild + totCMChild, ); indivChildFE = new Array( @@ -782,7 +782,7 @@ feStatChild, feStatChild, feStatChild, - feCMChild + feCMChild, ); break; } @@ -815,7 +815,7 @@ select.setAttribute("id", "choose"); select.setAttribute( "onchange", - "makeTotTable(document.getElementById('choose').value)" + "makeTotTable(document.getElementById('choose').value)", ); head = document.createElement("option"); txt0 = document.createTextNode("No Entry Selected"); @@ -885,7 +885,7 @@ document .getElementsByTagName("div") [index].removeChild( - document.getElementsByTagName("div")[index].firstChild + document.getElementsByTagName("div")[index].firstChild, ); } /* REMOVE ALL CHILDNODES (PARAM TABLE) */ @@ -895,7 +895,7 @@ document .getElementsByTagName("div") [index + 1].removeChild( - document.getElementsByTagName("div")[index + 1].firstChild + document.getElementsByTagName("div")[index + 1].firstChild, ); } index++; @@ -928,7 +928,7 @@ document .getElementsByTagName("div") [index].removeChild( - document.getElementsByTagName("div")[index].firstChild + document.getElementsByTagName("div")[index].firstChild, ); } /* REMOVE ALL CHILDNODES (PARAM TABLE) */ @@ -938,7 +938,7 @@ document .getElementsByTagName("div") [index + 1].removeChild( - document.getElementsByTagName("div")[index + 1].firstChild + document.getElementsByTagName("div")[index + 1].firstChild, ); } index++; @@ -982,7 +982,7 @@ cell_num - 1, cell_num - 1, cell_num, - cell_num - 1 + cell_num - 1, ); table = document.createElement("table"); @@ -1081,7 +1081,7 @@ k != 2 - (cell_num - cell_numArry[c]) ) { cont = document.createTextNode( - feArryMaster[k - 3].attributes[0].value + feArryMaster[k - 3].attributes[0].value, ); } else if (c == 0 && k == 2 - (cell_num - cell_numArry[c])) { cont = document.createTextNode("Total"); @@ -1145,7 +1145,7 @@ "Now", "2 Hours", "24 Hours", - "7 Days" + "7 Days", ); rowLength = rowsTwoTxt.length; } else { @@ -1198,7 +1198,7 @@ if (j % (rowLength / 2) == 0) { cols[j].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); colsTxt[j] = document.createTextNode(indivTableAtts[attribute]); attribute++; @@ -1234,7 +1234,7 @@ if ((j + k) % (rowLength / 2) == 0) { cols[j + k].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); colsTxt[j + k] = document.createTextNode(indivTableAtts[attribute]); attribute++; @@ -1268,10 +1268,10 @@ if ((j + k + l) % (rowLength / 2) == 0) { cols[j + k + l].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); colsTxt[j + k + l] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -1304,10 +1304,10 @@ if ((j + k + l + m) % (rowLength / 2) == 0) { cols[j + k + l + m].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); colsTxt[j + k + l + m] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -1341,10 +1341,10 @@ ) { cols[j + k + l + m + n].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); colsTxt[j + k + l + m + n] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -1724,7 +1724,7 @@ "Now", "2 Hours", "24 Hours", - "7 Days" + "7 Days", ); else feRowTwoTxt = new Array("", "Now", "", "Now"); index = 0; @@ -1803,7 +1803,7 @@ if (j % (feRowTwoTxt.length / 2) == 0) { feCell[j].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); feCellTxt[j] = document.createTextNode(indivTableAtts[attribute]); attribute++; @@ -1841,10 +1841,10 @@ if ((j + k) % (feRowTwoTxt.length / 2) == 0) { feCell[j + k].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); feCellTxt[j + k] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -1882,10 +1882,10 @@ if ((j + k + l) % (feRowTwoTxt.length / 2) == 0) { feCell[j + k + l].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); feCellTxt[j + k + l] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -1921,10 +1921,10 @@ if ((j + k + l + m) % (feRowTwoTxt.length / 2) == 0) { feCell[j + k + l + m].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); feCellTxt[j + k + l + m] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -1963,10 +1963,10 @@ ) { feCell[j + k + l + m + n].setAttribute( "bgColor", - colorArry[indivTableAttColors[attribute]] + colorArry[indivTableAttColors[attribute]], ); feCellTxt[j + k + l + m + n] = document.createTextNode( - indivTableAtts[attribute] + indivTableAtts[attribute], ); attribute++; } else { @@ -2002,7 +2002,7 @@ paramRow[0] = document.createElement( - "tr" + "tr", ); /* Will hold parameter table header. */ paramCell = document.createElement("td"); @@ -2011,7 +2011,7 @@ .length <= 1 ) { paramTxtHead = document.createTextNode( - "(" + feArryMaster[i].attributes[0].value + ") No Parameters " + "(" + feArryMaster[i].attributes[0].value + ") No Parameters ", ); } else paramTxtHead = document.createTextNode("Parameters: "); paramCell.appendChild(paramTxtHead); @@ -2034,11 +2034,11 @@ paramCell[j] = document.createElement("td"); paramCellTxt[j - 1] = document.createTextNode( feArryMaster[i].childNodes[feReqChild].childNodes[1].childNodes[j] - .attributes[0].value + .attributes[0].value, ); paramCellTxt[j] = document.createTextNode( feArryMaster[i].childNodes[feReqChild].childNodes[1].childNodes[j] - .attributes[1].value + .attributes[1].value, ); paramCell[j - 1].appendChild(paramCellTxt[j - 1]); paramCell[j].appendChild(paramCellTxt[j]); @@ -2490,7 +2490,7 @@ font-size: 40px; color: #000; font-weight: bold; - font-family: 'Times New Roman', Times; + font-family: "Times New Roman", Times; text-decoration: none; left: 50%; " diff --git a/creation/web_base/factoryLogStatus.html b/creation/web_base/factoryLogStatus.html index 7d5dcec0d..efd21005b 100644 --- a/creation/web_base/factoryLogStatus.html +++ b/creation/web_base/factoryLogStatus.html @@ -185,7 +185,7 @@ for (var entry in entries) { if (ec_added < groups_starting_idx) { entries_select.appendChild( - new Option(entries[entry], entries[entry]) + new Option(entries[entry], entries[entry]), ); ec_added++; } else { @@ -226,7 +226,7 @@ fes.appendChild(new Option("total", "total")); for (var frontend in frontend_list[entry]) { frontends_select.appendChild( - new Option(frontend_list[entry][frontend]) + new Option(frontend_list[entry][frontend]), ); } } @@ -240,7 +240,7 @@ "EnteredRunning", "ExitedRunning", "EnteredCompleted", - "EnteredHeld" + "EnteredHeld", ); gtype_DSs["idle"] = new Array( "StatusIdle", @@ -250,7 +250,7 @@ "EnteredWait", "ExitedWait", "EnteredRunning", - "EnteredHeld" + "EnteredHeld", ); gtype_DSs["other"] = new Array( "StatusHeld", @@ -258,7 +258,7 @@ "ExitedHeld", "EnteredRemoved", "EnteredIdle", - "EnteredRunning" + "EnteredRunning", ); gtype_DSs["completed"] = new Array( "Lasted", @@ -268,7 +268,7 @@ "JobsGoodput", "Glideins", "FailedNr", - "JobsNr" + "JobsNr", ); var gtype_formats = new Object(); @@ -471,7 +471,7 @@ "mygraph", rrd_data1, null, - gtype_formats[gtype_id] + gtype_formats[gtype_id], ); // Finally, update the files loaded so far diff --git a/creation/web_base/factoryRRDBrowse.html b/creation/web_base/factoryRRDBrowse.html index 542e72268..db5db4d51 100644 --- a/creation/web_base/factoryRRDBrowse.html +++ b/creation/web_base/factoryRRDBrowse.html @@ -151,7 +151,7 @@ "Log_Counts", "Log_Completed", "Log_Completed_Stats", - "Log_Completed_WasteTime" + "Log_Completed_WasteTime", ); var ENTRY; @@ -196,7 +196,7 @@ for (var entry in entries) { if (ec_added < groups_starting_idx) { entries_select.appendChild( - new Option(entries[entry], entries[entry]) + new Option(entries[entry], entries[entry]), ); ec_added++; } else { @@ -226,7 +226,7 @@ fes.appendChild(new Option("total", "total")); for (var frontend in frontend_list[entry]) { frontends_select.appendChild( - new Option(frontend_list[entry][frontend]) + new Option(frontend_list[entry][frontend]), ); } } diff --git a/creation/web_base/factoryRRDEntryMatrix.html b/creation/web_base/factoryRRDEntryMatrix.html index e3a823b84..823f082b8 100644 --- a/creation/web_base/factoryRRDEntryMatrix.html +++ b/creation/web_base/factoryRRDEntryMatrix.html @@ -224,7 +224,7 @@ "onclick", 'setGroupEntriesValue("' + entrylist2groupname(entries[entry]) + - '", true)' + '", true)', ); var but_el2 = document.createElement("input"); @@ -235,7 +235,7 @@ "onclick", 'setGroupEntriesValue("' + entrylist2groupname(entries[entry]) + - '", false)' + '", false)', ); var form_el = document.getElementById("selector"); @@ -390,7 +390,7 @@ var fn_array = new Array(); for (var j = 0; j < ent_list.length; j++) { fn_array.push( - "entry_" + ent_list[j] + "/total/" + rrd_name + ".rrd" + "entry_" + ent_list[j] + "/total/" + rrd_name + ".rrd", ); } fnames.push(fn_array.join(",")); @@ -413,7 +413,7 @@ FetchBinaryURLAsync( fn_array[j], update_grouped_fname_handler, - i + i, ); rrds_to_load++; } diff --git a/creation/web_base/factoryStatus.html b/creation/web_base/factoryStatus.html index 315ba52b5..9b5a215e9 100644 --- a/creation/web_base/factoryStatus.html +++ b/creation/web_base/factoryStatus.html @@ -201,7 +201,7 @@ for (var entry in entries) { if (ec_added < groups_starting_idx) { entries_select.appendChild( - new Option(entries[entry], entries[entry]) + new Option(entries[entry], entries[entry]), ); ec_added++; } else { @@ -227,7 +227,7 @@ fes.appendChild(new Option("total", "total")); for (var frontend in frontend_list[entry]) { frontends_select.appendChild( - new Option(frontend_list[entry][frontend]) + new Option(frontend_list[entry][frontend]), ); } } @@ -261,7 +261,7 @@ "ClientJobsIdle", "ReqIdle", "StatusIdle", - "ClientInfoAge" + "ClientInfoAge", ); gtype_DSs["idle"] = new Array( "ReqIdle", @@ -269,14 +269,14 @@ "StatusWait", "StatusPending", "ClientJobsIdle", - "ClientInfoAge" + "ClientInfoAge", ); gtype_DSs["other"] = new Array( "StatusHeld", "StatusStageIn", "StatusStageOut", "StatusIdleOther", - "StatusIdle" + "StatusIdle", ); gtype_formats = new Object(); @@ -519,7 +519,7 @@ use_element_buttons: false, }, gtype_DSs[gtype_id], - rra_ops + rra_ops, ); // Finally, update the files loaded so far @@ -636,7 +636,7 @@ "rra", "window_min", "window_max", - "timezone" + "timezone", ); group = 0; var entrySpec; diff --git a/creation/web_base/factoryStatusNow.html b/creation/web_base/factoryStatusNow.html index a81cea1d2..863fad2f1 100644 --- a/creation/web_base/factoryStatusNow.html +++ b/creation/web_base/factoryStatusNow.html @@ -110,7 +110,7 @@ "Unmatched cores", "User idle", "Registered cores", - "Info age" + "Info age", ); var headColArryPR = new Array( @@ -133,7 +133,7 @@ "Unmatched cores", "User idle", "Registered cores", - "Info age" + "Info age", ); var headColArryTR = new Array( @@ -145,7 +145,7 @@ "Status: Idle", "Requested: Idle", "Diff(Status: Idle, Requested: Idle)", - "Client: User Idle" + "Client: User Idle", ); var headColArryTRPR = new Array( @@ -157,7 +157,7 @@ "Status: Idle", "Requested: Idle", "Diff(Status: Idle, Requested: Idle)", - "Client: User Idle" + "Client: User Idle", ); var columnArray = new Array( @@ -181,7 +181,7 @@ "cmCoresIdle", "cmGlideinJobsIdle", "cmCoresTotal", - "cmGlideinInfoAge" + "cmGlideinInfoAge", ); /* columnArrayStruct describes columnArray: total length (length) and length and offset of its component: DT, Status, Req, CM it is used to display the table w/ the values @@ -217,7 +217,7 @@ "Client Monitor: Unmatched cores", "Client Monitor: User idle", "Client Monitor: Registered cores", - "Client Monitor: Info age" + "Client Monitor: Info age", ); var exactColumnsTR = new Array( @@ -229,7 +229,7 @@ "Status: Idle", "Requested: Idle", "Diff(Status: Idle, Requested: Idle)", - "Client Monitor: User Idle" + "Client Monitor: User Idle", ); var xmlAttPeriodArry = new Array( @@ -252,7 +252,7 @@ "ClientCoresIdle", "ClientJobsIdle", "ClientCoresTotal", - "ClientInfoAge" + "ClientInfoAge", ); /* ONE LESS ATT THAN DEFAULT, no Downtime */ var xmlAttDTArry = new Array("Status"); @@ -265,7 +265,7 @@ "StageOut", "IdleOther", "Held", - "RunningCores" + "RunningCores", ); var xmlAttReqArry = new Array("MaxGlideins", "Idle"); // var xmlAttCMArry = new Array("GlideRunning", "CoresRunning", "JobsRunHere", "JobsRunning", "GlideIdle", "CoresIdle", "JobsIdle", "GlideTotal", "CoresTotal", "InfoAge"); @@ -276,7 +276,7 @@ "CoresIdle", "JobsIdle", "CoresTotal", - "InfoAge" + "InfoAge", ); var xmlAttStatNumArry = new Array(); var xmlAttReqNumArry = new Array(); @@ -394,7 +394,7 @@ if (entry.childNodes[totChild].childNodes.length == 0) { /* POP UP TEXT CONTENTS */ nameTxtNode = document.createTextNode( - totalEntries[row - 1].getAttribute("name") + totalEntries[row - 1].getAttribute("name"), ); if (troubleshoot) attTxtNode = document.createTextNode(exactColumnsTR[column]); @@ -443,7 +443,7 @@ td3 = document.createElement("td"); td4 = document.createElement("td"); nameTxtNode = document.createTextNode( - totalEntries[row - 1].getAttribute("name") + totalEntries[row - 1].getAttribute("name"), ); if (troubleshoot) attTxtNode = document.createTextNode(exactColumnsTR[column]); @@ -520,7 +520,7 @@ tr = document.createElement("tr"); td = document.createElement("td"); txt = document.createTextNode( - sortedFE[i].attributes[0].value + ":" + sortedFE[i].attributes[0].value + ":", ); td2 = document.createElement("td"); @@ -546,12 +546,12 @@ diff = 0; try { val1 = parseInt( - sortedFE[i].childNodes[child1].attributes[att1].value + sortedFE[i].childNodes[child1].attributes[att1].value, ); } catch (err) {} try { val2 = parseInt( - sortedFE[i].childNodes[child2].attributes[att2].value + sortedFE[i].childNodes[child2].attributes[att2].value, ); } catch (err) {} diff = val1 - val2; @@ -562,7 +562,7 @@ txt2 = document.createTextNode( sortedFE[i].childNodes[feStatChild].attributes[ xmlAttTotalNumArry[column - 1] - ].value + ].value, ); } catch (err) { txt2 = document.createTextNode(0); @@ -576,7 +576,7 @@ txt2 = document.createTextNode( sortedFE[i].childNodes[feReqChild].attributes[ xmlAttTotalNumArry[column - 1] - ].value + ].value, ); } catch (err) { txt2 = document.createTextNode(0); @@ -587,7 +587,7 @@ txt2 = document.createTextNode( sortedFE[i].childNodes[feCMChild].attributes[ xmlAttTotalNumArry[column - 1] - ].value + ].value, ); } catch (err) { txt2 = document.createTextNode(0); @@ -754,21 +754,21 @@ if (entry.childNodes[totChild].childNodes.length == 0) { /* POP UP TEXT CONTENTS */ nameTxtNode = document.createTextNode( - tempTotalEntries[row].getAttribute("name") + tempTotalEntries[row].getAttribute("name"), ); if (!diffCol) attTxtNode = document.createTextNode( - exactColumns[column + 1] + timeFrame + exactColumns[column + 1] + timeFrame, ); else if (diffCol == 1) attTxtNode = document.createTextNode( "Diff(Status: Running cores, Client: Registered cores) " + - timeFrame + timeFrame, ); else attTxtNode = document.createTextNode( - "Diff(Status: Idle, Requested: Idle) " + timeFrame + "Diff(Status: Idle, Requested: Idle) " + timeFrame, ); NFE = document.createTextNode("No Frontends Exist"); @@ -815,18 +815,19 @@ td3 = document.createElement("td"); td4 = document.createElement("td"); cont = document.createTextNode( - tempTotalEntries[row].getAttribute("name") + tempTotalEntries[row].getAttribute("name"), ); if (!diffCol) cont2 = document.createTextNode(exactColumns[column + 1] + timeFrame); else if (diffCol == 1) cont2 = document.createTextNode( - "Diff(Status: Running cores, Client: Registered cores) " + timeFrame + "Diff(Status: Running cores, Client: Registered cores) " + + timeFrame, ); else cont2 = document.createTextNode( - "Diff(Status: Idle, Requested: Idle) " + timeFrame + "Diff(Status: Idle, Requested: Idle) " + timeFrame, ); td1.appendChild(cont); @@ -894,7 +895,7 @@ tr = document.createElement("tr"); td = document.createElement("td"); txt = document.createTextNode( - sortedFE[i].attributes[0].value + ":" + sortedFE[i].attributes[0].value + ":", ); td2 = document.createElement("td"); @@ -936,7 +937,7 @@ ].value - sortedFE[i].childNodes[trFEChildArry[1]].attributes[ xmlAttTotalNumArry[dCol2] - ].value + ].value, ); } else { /* 2ND DIFF COL */ @@ -946,7 +947,7 @@ ].value - sortedFE[i].childNodes[trFEChildArry[4]].attributes[ xmlAttTotalNumArry[dCol2] - ].value + ].value, ); } } else { @@ -960,8 +961,8 @@ .childNodes[1].childNodes[pr].attributes[ xmlAttPeriodNumArry[dCol2 - 1] ].value) * - 100 - ) / 100 + 100, + ) / 100, ); } } else if (column < columnArrayDesc.Req.offset - 1) { @@ -971,7 +972,7 @@ txt2 = document.createTextNode( sortedFE[i].childNodes[feStatChild].attributes[ xmlAttTotalNumArry[column] - ].value + ].value, ); } else { txt2 = document.createTextNode( @@ -979,8 +980,8 @@ tempTotalEntriesP[row].childNodes[3].childNodes[prFEChild] .childNodes[1].childNodes[pr].attributes[ xmlAttPeriodNumArry[column - 1] - ].value * 100 - ) / 100 + ].value * 100, + ) / 100, ); } } else txt2 = document.createTextNode(0); @@ -994,7 +995,7 @@ txt2 = document.createTextNode( sortedFE[i].childNodes[feReqChild].attributes[ xmlAttTotalNumArry[column] - ].value + ].value, ); } else { txt2 = document.createTextNode( @@ -1002,8 +1003,8 @@ tempTotalEntriesP[row].childNodes[3].childNodes[prFEChild] .childNodes[1].childNodes[pr].attributes[ xmlAttPeriodNumArry[column - 1] - ].value * 100 - ) / 100 + ].value * 100, + ) / 100, ); } } else txt2 = document.createTextNode(0); @@ -1014,7 +1015,7 @@ txt2 = document.createTextNode( sortedFE[i].childNodes[feCMChild].attributes[ xmlAttTotalNumArry[column] - ].value + ].value, ); } else { txt2 = document.createTextNode( @@ -1022,8 +1023,8 @@ tempTotalEntriesP[row].childNodes[3].childNodes[prFEChild] .childNodes[1].childNodes[pr].attributes[ xmlAttPeriodNumArry[column - 1] - ].value * 100 - ) / 100 + ].value * 100, + ) / 100, ); } } else txt2 = document.createTextNode(0); @@ -1229,7 +1230,7 @@ select.setAttribute("id", "choose"); select.setAttribute( "onchange", - "loadFrontEnd(document.getElementById('choose').value)" + "loadFrontEnd(document.getElementById('choose').value)", ); def = document.createElement("option"); defTxt = document.createTextNode("Total (Default)"); @@ -1655,7 +1656,7 @@ childView = j; feEntries.push(totalEntries[i]); feTotal.push( - totalEntries[i].childNodes[feChild].childNodes[j] + totalEntries[i].childNodes[feChild].childNodes[j], ); feEntriesP.push(totalEntriesP[i]); feTotalP.push(totalEntriesP[i].childNodes[3].childNodes[j]); @@ -1894,12 +1895,12 @@ links[i].setAttribute("onbrowseover", "hideEntryName()"); links[i].setAttribute( "onmouseover", - "showPopUpSubEntries(this, '" + y + "')" + "showPopUpSubEntries(this, '" + y + "')", ); links[i].setAttribute("onmouseout", "hidePopUpSubEntries()"); links[i].setAttribute( "href", - "factoryEntryStatusNow.html?entry=" + y + "factoryEntryStatusNow.html?entry=" + y, ); links[i].setAttribute("onclick", "entryClick(this)"); table.rows[i].cells[0].appendChild(links[i]); @@ -2084,7 +2085,7 @@ xmlhttp.responseXML.documentElement.getElementsByTagName("total"); frontEndsP = xmlhttp.responseXML.documentElement.getElementsByTagName( - "frontend" + "frontend", ); totalEntriesP = xmlhttp.responseXML.documentElement.getElementsByTagName("entry"); @@ -2132,19 +2133,19 @@ xmlhttp.onreadystatechange = function () { if (!active) document.getElementById( - "active" + "active", ).checked = false; /* Reset active check box. */ if (!updating && !period && !prTr) document.getElementById( - "period" + "period", ).checked = false; /* Reset troubleshoot box. */ if (!updating && !troubleshoot && !prTr) document.getElementById( - "troubleshoot" + "troubleshoot", ).checked = false; /* Reset troubleshoot box. */ if (!periodV && !prTr) document.getElementById( - "period" + "period", ).checked = false; /* Reset active check box. */ if (xmlhttp.readyState == 4) { @@ -2157,7 +2158,7 @@ /* GET ALL NECESSARY INFO FROM THE XML */ updated = xmlhttp.responseXML.documentElement.getElementsByTagName( - "updated" + "updated", ); showTime(); totalEntriesMaster = @@ -2166,13 +2167,13 @@ xmlhttp.responseXML.documentElement.getElementsByTagName("total"); frontEnds = xmlhttp.responseXML.documentElement.getElementsByTagName( - "frontend" + "frontend", ); totalEntries = xmlhttp.responseXML.documentElement.getElementsByTagName("entry"); statusEntries = xmlhttp.responseXML.documentElement.getElementsByTagName( - "StatusEntries" + "StatusEntries", ); total = xmlhttp.responseXML.documentElement.getElementsByTagName("total"); @@ -2761,28 +2762,28 @@ 1, columnArrayDesc.Status.length, columnArrayDesc.Req.length, - columnArrayDesc.CM.length + columnArrayDesc.CM.length, ); headTxt = new Array( "", "", "Status: ", "Requested: ", - "Client Monitor: " + "Client Monitor: ", ); headId = new Array( "empty", "downtime", "status", "requested", - "client" + "client", ); headClr = new Array( "#DCDCDC", "#DCDCDC", "#FAF0E6", "#FFDAB9", - "#CDAF95" + "#CDAF95", ); /* HEADER */ @@ -3006,7 +3007,7 @@ 3, 3, 3, - 3 + 3, ); /* 1 DT + 9 STAT + 4 REQ + 10 CM = 24 */ trSortColNumArry = new Array( 0, @@ -3026,7 +3027,7 @@ 0, 0, 8, - 3 + 3, ); feChildArry = new Array(feStatChild, feReqChild, feCMChild); totChildArry = new Array(totStatChild, totReqChild, totCMChild); @@ -3878,7 +3879,7 @@ "Status: Idle", "Requested: Idle", "Diff(Status: Idle, Requested: Idle)", - "Client: User Idle" + "Client: User Idle", ); trColumnId = new Array( "entryLinks", @@ -3889,7 +3890,7 @@ "status", "requested", "difference", - "client" + "client", ); colors = new Array( "#DCDCDC", @@ -3900,7 +3901,7 @@ "#FAF0E6", "#FFDAB9", "#7D9EC0", - "#CDAF95" + "#CDAF95", ); /* SET CHILD ARRAY */ @@ -3910,7 +3911,7 @@ feCMChild, feStatChild, feReqChild, - feCMChild + feCMChild, ); else child = new Array( @@ -3918,7 +3919,7 @@ totCMChild, totStatChild, totReqChild, - totCMChild + totCMChild, ); count = 0; @@ -3982,7 +3983,7 @@ hrefs[i - 1].innerHTML = y; hrefs[i - 1].setAttribute( "href", - "factoryEntryStatusNow.html?entry=" + y + "factoryEntryStatusNow.html?entry=" + y, ); hrefs[i - 1].setAttribute("onclick", "entryClick(this)"); cols[j].appendChild(hrefs[i - 1]); @@ -4027,7 +4028,7 @@ tempTotalEntries[i - 1].childNodes[totChild] .childNodes[child[count - 2]].attributes[ att[count - 2] - ].value + ].value, ); } catch (err) { val1 = 0; @@ -4037,7 +4038,7 @@ tempTotalEntries[i - 1].childNodes[totChild] .childNodes[child[count - 1]].attributes[ att[count - 1] - ].value + ].value, ); } catch (err) { val2 = 0; @@ -4047,7 +4048,7 @@ val1 = parseInt( tempTotalEntries[i - 1].childNodes[feChild] .childNodes[childView].childNodes[child[count - 2]] - .attributes[att[count - 2]].value + .attributes[att[count - 2]].value, ); } catch (err) { val1 = 0; @@ -4056,7 +4057,7 @@ val2 = parseInt( tempTotalEntries[i - 1].childNodes[feChild] .childNodes[childView].childNodes[child[count - 1]] - .attributes[att[count - 1]].value + .attributes[att[count - 1]].value, ); } catch (err) { val2 = 0; @@ -4191,7 +4192,7 @@ "Status: Idle", "Requested: Idle", "diff", - "Client: User Idle" + "Client: User Idle", ); sortColNum = new Array( "statusRunning", @@ -4200,11 +4201,11 @@ "statusIdle", "requestIdle", "diff", - "cmGlideinJobsIdle" + "cmGlideinJobsIdle", ); diffCol = new Array( "Diff(Status: Running cores, Client: Registered cores)", - "Diff(Status: Idle, Requested: Idle)" + "Diff(Status: Idle, Requested: Idle)", ); if (!prTr) diffCell = new Array(4, 7); @@ -4219,7 +4220,7 @@ totStatChild, totCMChild, totStatChild, - totReqChild + totReqChild, ); att = new Array(5, 2, 1, 0); // child and att are used only for the diff values @@ -4255,7 +4256,7 @@ sorted = temp; } trSortSignal( - tempHold + 2 + tempHold + 2, ); /* ENTRY NAME COL + DOWNTIME STATUS COL = 2 */ return; } @@ -4281,14 +4282,14 @@ if (!prTr) { for (k = 0; k < trTable.rows.length; k++) { diffArry.push( - parseInt(trTable.rows[k].cells[diffCell[j]].innerHTML) + parseInt(trTable.rows[k].cells[diffCell[j]].innerHTML), ); } } else { for (k = 0; k < trpr_Table.rows.length; k++) { if (k % 4 == 0) { diffArry.push( - parseInt(trpr_Table.rows[k].cells[diffCell[j]].innerHTML) + parseInt(trpr_Table.rows[k].cells[diffCell[j]].innerHTML), ); } } @@ -4387,7 +4388,8 @@ try { val1 = parseInt( totalEntries[k].childNodes[feChild].childNodes[childView] - .childNodes[child[helper]].attributes[att[helper]].value + .childNodes[child[helper]].attributes[att[helper]] + .value, ); } catch (err) {} try { @@ -4395,7 +4397,7 @@ totalEntries[k].childNodes[feChild].childNodes[childView] .childNodes[child[helper + 1]].attributes[ att[helper + 1] - ].value + ].value, ); } catch (err) {} diff = val1 - val2; @@ -4432,14 +4434,14 @@ val1 = parseInt( totalEntries[k].childNodes[totChild].childNodes[ child[helper] - ].attributes[att[helper]].value + ].attributes[att[helper]].value, ); } catch (err) {} try { val2 = parseInt( totalEntries[k].childNodes[totChild].childNodes[ child[helper + 1] - ].attributes[att[helper + 1]].value + ].attributes[att[helper + 1]].value, ); } catch (err) {} diff = val1 - val2; @@ -4659,7 +4661,7 @@ "Status: Idle", "Requested: Idle", "Diff(Status: Idle, Requested: Idle)", - "Client: User Idle" + "Client: User Idle", ); colors = new Array( "#DCDCDC", @@ -4671,7 +4673,7 @@ "#FAF0E6", "#FFDAB9", "#7D9EC0", - "#CDAF95" + "#CDAF95", ); trColumnId = new Array( "entryLinks", @@ -4683,7 +4685,7 @@ "status", "requested", "difference", - "client" + "client", ); /* FRONTEND VIEW */ @@ -4693,7 +4695,7 @@ feCMChild, feStatChild, feReqChild, - feCMChild + feCMChild, ); /* TOTAL VIEW */ else child = new Array( @@ -4701,7 +4703,7 @@ totCMChild, totStatChild, totReqChild, - totCMChild + totCMChild, ); /* ARRAYS FOR INFO ACCESSING */ @@ -4713,7 +4715,7 @@ totStatChild, totReqChild, 0, - totCMChild + totCMChild, ); trFEChildArry = new Array( feStatChild, @@ -4722,19 +4724,19 @@ feStatChild, feReqChild, 0, - feCMChild + feCMChild, ); // StatusRunningCores(Running cores) , ClientCoresTotal(Registered cores), StatusIdle(Idle), ReqIdle(Idle), ClientJobsIdle(User idle) // using columnArrayDesc, i starts w/ Entry_name, xmlAttTotalNumArry starts w/ DT (-1), xmlAttPeriodNumArry starts w/ Status (-columnArrayDesc.Status.offset) // In elements offset: 8, 5, -, 1, 1, -, 4 trAttArry = new Array(); trAttArry.push( - xmlAttTotalNumArry[columnArrayDesc.Status.offset - 1 + 8] + xmlAttTotalNumArry[columnArrayDesc.Status.offset - 1 + 8], ); trAttArry.push(xmlAttTotalNumArry[columnArrayDesc.CM.offset - 1 + 5]); trAttArry.push(0); trAttArry.push( - xmlAttTotalNumArry[columnArrayDesc.Status.offset - 1 + 1] + xmlAttTotalNumArry[columnArrayDesc.Status.offset - 1 + 1], ); trAttArry.push(xmlAttTotalNumArry[columnArrayDesc.Req.offset - 1 + 1]); trAttArry.push(0); @@ -4745,20 +4747,20 @@ prAttArry.push( xmlAttPeriodNumArry[ columnArrayDesc.CM.offset - columnArrayDesc.Status.offset + 5 - ] + ], ); prAttArry.push(0); prAttArry.push(xmlAttPeriodNumArry[1]); // columnArrayDesc.Status.offset-columnArrayDesc.Status.offset+1 prAttArry.push( xmlAttPeriodNumArry[ columnArrayDesc.Req.offset - columnArrayDesc.Status.offset + 1 - ] + ], ); prAttArry.push(0); prAttArry.push( xmlAttPeriodNumArry[ columnArrayDesc.CM.offset - columnArrayDesc.Status.offset + 4 - ] + ], ); rows = new Array(); @@ -4827,7 +4829,7 @@ cols[k].setAttribute("onmouseout", "hidePopUp()"); cols[k - 1].setAttribute( "onmouseover", - "showPopUpPeriod(this)" + "showPopUpPeriod(this)", ); cols[k - 1].setAttribute("id", c); cols[k - 1].setAttribute("onmouseout", "hidePopUp()"); @@ -4869,7 +4871,7 @@ links[i].innerHTML = y; links[i].setAttribute( "href", - "factoryEntryStatusNow.html?entry=" + y + "factoryEntryStatusNow.html?entry=" + y, ); links[i].setAttribute("onclick", "entryClick(this)"); trpr_Table.rows[i].cells[0].appendChild(links[i]); @@ -5166,7 +5168,7 @@ "#FFFAF0", "#FAF0E6", "#FFDAB9", - "#CDAF95" + "#CDAF95", ); hArry2 = new Array( "", @@ -5174,7 +5176,7 @@ "Period:", "Status:", "Requested:", - "Client Monitor:" + "Client Monitor:", ); // hArry3 = new Array(1, 1, 1,xmlAttStatNumArry.length, xmlAttReqNumArry.length, xmlAttCMNumArry.length); hArry3 = new Array( @@ -5183,7 +5185,7 @@ 1, columnArrayDesc.Status.length, columnArrayDesc.Req.length, - columnArrayDesc.CM.length + columnArrayDesc.CM.length, ); /* @@ -5240,7 +5242,7 @@ cell[k].setAttribute("onmouseout", "hidePopUp()"); cell[k - 1].setAttribute( "onmouseover", - "showPopUpPeriod(this)" + "showPopUpPeriod(this)", ); cell[k - 1].setAttribute("id", c); cell[k - 1].setAttribute("onmouseout", "hidePopUp()"); @@ -5337,7 +5339,7 @@ links[i].innerHTML = y; links[i].setAttribute( "href", - "factoryEntryStatusNow.html?entry=" + y + "factoryEntryStatusNow.html?entry=" + y, ); links[i].setAttribute("onclick", "entryClick(this)"); tableP.rows[i].cells[0].appendChild(links[i]); diff --git a/creation/web_base/factory_support.js b/creation/web_base/factory_support.js index ed5786edb..deb427fb6 100644 --- a/creation/web_base/factory_support.js +++ b/creation/web_base/factory_support.js @@ -86,7 +86,7 @@ function getFactoryFrontends(factoryQStats) { var frontend_name = el3.attributes[0].value.toString(); groups[entry_name.value].push( - frontend_name + frontend_name, ); } } @@ -134,16 +134,16 @@ function getFactoryEntryGroups(factoryQStats) { ) { var group_name = grp.attributes.getNamedItem( - "group_name" + "group_name", ); if (group_name.value in groups) { groups[group_name.value].push( - entry_name.value + entry_name.value, ); } else { groups[group_name.value] = new Array(); groups[group_name.value].push( - entry_name.value + entry_name.value, ); } } @@ -174,7 +174,7 @@ function set_title_and_footer(browser_title, page_title) { //4 == READY factory_info = xmlhttp_descript.responseXML.documentElement.getElementsByTagName( - "factory" + "factory", ); for (var i = 0; i < factory_info[0].attributes.length; i++) { diff --git a/creation/web_base/frontendGroupGraphStatusNow.html b/creation/web_base/frontendGroupGraphStatusNow.html index 878901982..418b8c689 100644 --- a/creation/web_base/frontendGroupGraphStatusNow.html +++ b/creation/web_base/frontendGroupGraphStatusNow.html @@ -86,9 +86,9 @@ chartData.push( simpleEncoding.charAt( Math.round( - ((simpleEncoding.length - 1) * currentValue) / maxValue - ) - ) + ((simpleEncoding.length - 1) * currentValue) / maxValue, + ), + ), ); } else { chartData.push("_"); @@ -109,7 +109,7 @@ var numericVal = new Number(arrVals[i]); // Scale the value to maxVal. var scaledVal = Math.floor( - (EXTENDED_MAP_LENGTH * EXTENDED_MAP_LENGTH * numericVal) / maxVal + (EXTENDED_MAP_LENGTH * EXTENDED_MAP_LENGTH * numericVal) / maxVal, ); if (scaledVal > EXTENDED_MAP_LENGTH * EXTENDED_MAP_LENGTH - 1) { @@ -169,8 +169,8 @@ return ( decodeURIComponent( (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec( - location.search - ) || [, ""])[1].replace(/\+/g, "%20") + location.search, + ) || [, ""])[1].replace(/\+/g, "%20"), ) || null ); } @@ -263,7 +263,7 @@ window.history.pushState( { group: selected_group }, "", - addParameter(document.location.href, "group", selected_group) + addParameter(document.location.href, "group", selected_group), ); } else { going_back = false; @@ -321,7 +321,7 @@ group_name + "'>" + group_name + - " " + " ", ); if (first_group == true) { @@ -367,7 +367,7 @@ .each(function () { if ($(this).attr("name") == "Local") { $("#updated_display").html( - "Snapshot last updated: " + $(this).attr("human") + "Snapshot last updated: " + $(this).attr("human"), ); } }); @@ -400,7 +400,7 @@ } else { $(input_array).each(function () { toReturn.push( - (parseFloat(this) / parseFloat(normalized_total)) * 100.0 + (parseFloat(this) / parseFloat(normalized_total)) * 100.0, ); }); } @@ -455,11 +455,11 @@ data.setCell(counter, 0, entry_name); var matched_idle_glideins = parseFloat( - $(this).find("MatchedGlideins").attr("Idle") + $(this).find("MatchedGlideins").attr("Idle"), ); matchedglideins_idle.push(matched_idle_glideins); var matched_running_glideins = parseFloat( - $(this).find("MatchedGlideins").attr("Running") + $(this).find("MatchedGlideins").attr("Running"), ); matchedglideins_running.push(matched_running_glideins); data.setCell(counter, 3, matched_running_glideins); @@ -482,29 +482,29 @@ data.setCell(counter, 2, mji); matchedjobs_running.push( - parseFloat($(this).find("MatchedJobs").attr("RunningHere")) + parseFloat($(this).find("MatchedJobs").attr("RunningHere")), ); data.setCell( counter, 1, - parseFloat($(this).find("MatchedJobs").attr("RunningHere")) + parseFloat($(this).find("MatchedJobs").attr("RunningHere")), ); requested_idle.push( - parseFloat($(this).find("Requested").attr("Idle")) + parseFloat($(this).find("Requested").attr("Idle")), ); data.setCell( counter, 7, - parseFloat($(this).find("Requested").attr("Idle")) + parseFloat($(this).find("Requested").attr("Idle")), ); requested_max_running.push( - parseFloat($(this).find("Requested").attr("MaxGlideins")) + parseFloat($(this).find("Requested").attr("MaxGlideins")), ); data.setCell( counter, 6, - parseFloat($(this).find("Requested").attr("MaxGlideins")) + parseFloat($(this).find("Requested").attr("MaxGlideins")), ); counter++; @@ -518,7 +518,7 @@ "No Entry Points Detected", "No entry points were detected in the group: " + group_name + - ".

Please select another group from the menu on the left.

" + ".

Please select another group from the menu on the left.

", ); // If no jobs are detected, idle or running @@ -536,7 +536,7 @@ "No Jobs Detected", "No jobs were detected, idle or running, in the group: " + group_name + - ".

Please select another group from the menu on the left.

" + ".

Please select another group from the menu on the left.

", ); } else { $("#group_graphs").fadeTo(0, 1.0); @@ -562,7 +562,7 @@ data.setCell( counter, 5, - Math.round(SumElements(matchedglideins_idlefra) * 100) / 100.0 + Math.round(SumElements(matchedglideins_idlefra) * 100) / 100.0, ); data.setCell(counter, 6, SumElements(requested_max_running)); data.setCell(counter, 7, SumElements(requested_idle)); @@ -574,7 +574,7 @@ factories.slice(), matchedglideins_idle, "Glideins not matched", - img + img, ); img = CreateGraphImage(); @@ -586,7 +586,7 @@ factories.slice(), matchedglideins_running, "Glideins claimed by jobs", - img + img, ); img = CreateGraphImage(); @@ -599,7 +599,7 @@ factories.slice(), matchedjobs_running, "Running jobs by Entry", - img + img, ); img = CreateGraphImage(); @@ -612,11 +612,11 @@ factories.slice(), requested_max_running, "Requested Max Running", - img + img, ); table = new google.visualization.Table( - document.getElementById("group_table") + document.getElementById("group_table"), ); var dataview = new google.visualization.DataView(data); table.draw(dataview); @@ -638,7 +638,7 @@ .html( '
Unable to load image: ' + img_title + - "
" + "
", ); }); $(img).click(function () { @@ -699,7 +699,7 @@ entry_data[i][0] + " (" + Math.round(entry_data[i][1] * 10) / 10.0 + - ")" + ")", ); } baseurl += formatted_entry_points.join("|"); @@ -720,7 +720,7 @@ function ShowDialog(tocenter_object, title, text) { HideDialog(); $(tocenter_object).append( - "
' + text + "
" + "
' + text + "
", ); $("#error_dialog") .dialog({ diff --git a/creation/web_base/frontendRRDGroupMatrix.html b/creation/web_base/frontendRRDGroupMatrix.html index c21c7aaba..0eeef7157 100644 --- a/creation/web_base/frontendRRDGroupMatrix.html +++ b/creation/web_base/frontendRRDGroupMatrix.html @@ -203,7 +203,7 @@ for (var i in group_names) { fnames.push( - "group_" + group_names[i] + "/total/" + rrd_name + ".rrd" + "group_" + group_names[i] + "/total/" + rrd_name + ".rrd", ); rrd_data.push(null); } diff --git a/creation/web_base/frontendStatus.html b/creation/web_base/frontendStatus.html index ddee380ed..1af12eccb 100644 --- a/creation/web_base/frontendStatus.html +++ b/creation/web_base/frontendStatus.html @@ -239,7 +239,7 @@ "MatchCoreRunning", "MatchJobIdle", "ReqIdle", - "ReqMaxRun" + "ReqMaxRun", ); // 'JobsRunning', 'GlideinTotal', 'GlideinRunning', 'GlideinIdle', 'JobsIdle'); gtype_DSs["idle"] = new Array( @@ -254,7 +254,7 @@ "MatchCoreIdle", "MatchCoreRunning", "ReqIdle", - "ReqMaxRun" + "ReqMaxRun", ); var gtype_formats = new Object(); @@ -501,7 +501,7 @@ window_max: local_window_max, use_checked_DSs: true, use_element_buttons: true, - } + }, ); } @@ -569,7 +569,7 @@ "rra", "window_min", "window_max", - "timezone" + "timezone", ); var groupSpec; var infoGroupSpec; @@ -610,11 +610,11 @@ // as seen in the factory menu. var state_list = getFrontendGroupStates( loadFrontendStats(), - groups[group] + groups[group], ); var fac_list = getFrontendGroupFactories( loadFrontendStats(), - groups[group] + groups[group], ); //states listed first in the Factory menu, so push factories onto state list diff --git a/creation/web_base/frontendStatusNow.html b/creation/web_base/frontendStatusNow.html index f91302202..a646432d7 100644 --- a/creation/web_base/frontendStatusNow.html +++ b/creation/web_base/frontendStatusNow.html @@ -208,7 +208,9 @@ text-align: left; } #button { - font-family: Lucida Console, monospace; + font-family: + Lucida Console, + monospace; font-weight: bold; color: #330000; width: 110px; diff --git a/creation/web_base/frontend_support.js b/creation/web_base/frontend_support.js index 38b8fe292..2199e27cd 100644 --- a/creation/web_base/frontend_support.js +++ b/creation/web_base/frontend_support.js @@ -47,7 +47,7 @@ function getFrontendGroupFoS( frontendStats, group_name, fos_tag_top, - fos_tag_one + fos_tag_one, ) { factories = new Array(); @@ -88,7 +88,7 @@ function getFrontendGroupFoS( if (factory.nodeName == fos_tag_one) { factory_name = factory.attributes.getNamedItem( - "name" + "name", ); factories.push(factory_name.value); } @@ -109,7 +109,7 @@ function getFrontendGroupFactories(frontendStats, group_name) { frontendStats, group_name, "factories", - "factory" + "factory", ); } @@ -147,7 +147,7 @@ function set_title_and_footer(browser_title, page_title) { //4 == READY frontend_info = xmlhttp_descript.responseXML.documentElement.getElementsByTagName( - "frontend" + "frontend", ); frontend_name = frontend_info[0].attributes[0].value; document.getElementById("pgtitle").innerHTML = @@ -157,7 +157,7 @@ function set_title_and_footer(browser_title, page_title) { footer_info = xmlhttp_descript.responseXML.documentElement.getElementsByTagName( - "monitor_footer" + "monitor_footer", ); footer_text = footer_info[0].attributes[0].value; footer_link = footer_info[0].attributes[1].value; diff --git a/factory/glideFactory.py b/factory/glideFactory.py index 6260ddcc1..9ffe97813 100755 --- a/factory/glideFactory.py +++ b/factory/glideFactory.py @@ -213,7 +213,6 @@ def generate_log_tokens(startup_dir, glideinDescript): # Issue a token for each entry-recipient pair for entry in entries: - # Get the list of recipients if "LOG_RECIPIENTS_FACTORY" in glideFactoryConfig.JobParams(entry).data: log_recipients = glideFactoryConfig.JobParams(entry).data["LOG_RECIPIENTS_FACTORY"].split() diff --git a/factory/glideFactoryConfig.py b/factory/glideFactoryConfig.py index eeffee3fd..c2ad22295 100644 --- a/factory/glideFactoryConfig.py +++ b/factory/glideFactoryConfig.py @@ -46,6 +46,7 @@ def __init__(self): # ############################################################ + # loads a file composed of # NAME VAL # and creates diff --git a/factory/glideFactoryDowntimeLib.py b/factory/glideFactoryDowntimeLib.py index eba605d17..fb0fa494c 100644 --- a/factory/glideFactoryDowntimeLib.py +++ b/factory/glideFactoryDowntimeLib.py @@ -85,6 +85,7 @@ def purgeOldPeriods(self, cut_time=None, raise_on_error=False): # INTERNAL - Do not use ############################# + # return a list of downtime periods (utimes) # a value of None idicates "forever" # for example: [(1215339200,1215439170),(1215439271,None)] diff --git a/factory/glideFactoryEntry.py b/factory/glideFactoryEntry.py index 6973537d4..73ec307bf 100644 --- a/factory/glideFactoryEntry.py +++ b/factory/glideFactoryEntry.py @@ -1204,7 +1204,6 @@ def unit_work_v3( ) if entry.isSecurityClassInDowntime(client_security_name, credential_security_class): - # Cannot use proxy for submission but entry is not in downtime # since other proxies may map to valid security classes entry.log.warning( @@ -1871,7 +1870,6 @@ def update_entries_stats(factory_in_downtime, entry_list): updated_entries = [] for entry in entry_list: - # Add a heuristic to improve efficiency. Skip if no changes in the entry # if nothing_to_do: # continue @@ -1924,6 +1922,7 @@ def update_entries_stats(factory_in_downtime, entry_list): ############################################################ + # added by C.W. Murphy for glideFactoryEntryDescript def write_descript(entry_name, entryDescript, entryAttributes, entryParams, monitor_dir): entry_data = {entry_name: {}} diff --git a/factory/glideFactoryEntryGroup.py b/factory/glideFactoryEntryGroup.py index 7f84114db..bb9c8341c 100755 --- a/factory/glideFactoryEntryGroup.py +++ b/factory/glideFactoryEntryGroup.py @@ -504,7 +504,6 @@ def iterate(parent_pid, sleep_time, advertize_rate, glideinDescript, frontendDes factory_downtimes = glideFactoryDowntimeLib.DowntimeFile(glideinDescript.data["DowntimesFile"]) while True: - # Check if parent is still active. If not cleanup and die. check_parent(parent_pid, glideinDescript, my_entries) diff --git a/factory/glideFactoryInterface.py b/factory/glideFactoryInterface.py index fc2013f26..a6fae1c6b 100644 --- a/factory/glideFactoryInterface.py +++ b/factory/glideFactoryInterface.py @@ -273,7 +273,7 @@ def findGroupWork( kel = data[k] el = {"requests": {}, "web": {}, "params": {}, "params_decrypted": {}, "monitor": {}, "internals": {}} - for (key, prefix) in ( + for key, prefix in ( ("requests", factoryConfig.client_req_prefix), ("web", factoryConfig.client_web_prefix), ("params", factoryConfig.glidein_param_prefix), @@ -318,7 +318,7 @@ def findGroupWork( invalid_classad = False - for (key, prefix) in (("params_decrypted", factoryConfig.encrypted_param_prefix),): + for key, prefix in (("params_decrypted", factoryConfig.encrypted_param_prefix),): # TODO: useless for, only one element plen = len(prefix) for attr in kel: @@ -486,7 +486,7 @@ def findWork( for k in list(data.keys()): kel = data[k] el = {"requests": {}, "web": {}, "params": {}, "params_decrypted": {}, "monitor": {}, "internals": {}} - for (key, prefix) in ( + for key, prefix in ( ("requests", factoryConfig.client_req_prefix), ("web", factoryConfig.client_web_prefix), ("params", factoryConfig.glidein_param_prefix), @@ -526,7 +526,7 @@ def findWork( continue # uh oh... either the client is misconfigured, or someone is trying to cheat invalid_classad = False - for (key, prefix) in (("params_decrypted", factoryConfig.encrypted_param_prefix),): + for key, prefix in (("params_decrypted", factoryConfig.encrypted_param_prefix),): plen = len(prefix) for attr in list(kel.keys()): if attr in reserved_names: @@ -642,7 +642,7 @@ def __init__( self.adParams["GlideinRequireGlideinProxy"] = "%s" % True # write out both the attributes, params and monitors - for (prefix, data) in ( + for prefix, data in ( (factoryConfig.glidein_attr_prefix, glidein_attrs), (factoryConfig.glidein_param_prefix, glidein_params), (factoryConfig.glidein_monitor_prefix, glidein_monitors), @@ -715,7 +715,6 @@ def __init__(self, factory_name, glidein_name, supported_signtypes, pub_key_obj) def advertizeGlobal( factory_name, glidein_name, supported_signtypes, pub_key_obj, stats_dict={}, factory_collector=DEFAULT_VAL ): - """ Creates the glidefactoryglobal classad and advertises. @@ -803,6 +802,7 @@ def deadvertizeFactory(factory_name, glidein_name, factory_collector=DEFAULT_VAL ############################################################ + # glidein_attrs is a dictionary of values to publish # like {"Arch":"INTEL","MinDisk":200000} # similar for glidein_params and glidein_monitor_monitors @@ -962,6 +962,7 @@ def writeToMultiClassadFile(self, filename=None, append=True): ############################## # Start INTERNAL + # glidein_attrs is a dictionary of values to publish # like {"Arch":"INTEL","MinDisk":200000} # similar for glidein_params and glidein_monitor_monitors @@ -1021,7 +1022,7 @@ def createGlideinClientMonitoringFile( fd.write("UpdateSequenceNumber = %i\n" % advertizeGFCCounter[client_name]) # write out both the attributes, params and monitors - for (prefix, data) in ( + for prefix, data in ( (factoryConfig.glidein_attr_prefix, glidein_attrs), (factoryConfig.glidein_param_prefix, client_params), (factoryConfig.glidein_monitor_prefix, client_monitors), diff --git a/factory/glideFactoryLib.py b/factory/glideFactoryLib.py index c20c20fe1..2b6a9c53b 100644 --- a/factory/glideFactoryLib.py +++ b/factory/glideFactoryLib.py @@ -173,7 +173,6 @@ def secClass2Name(client_security_name, proxy_security_class): def getCondorQData(entry_name, client_name, schedd_name, factoryConfig=None): - """ Get Condor data, given the glidein name To be passed to the main functions @@ -405,7 +404,6 @@ def getCondorStatusData( client_startd_attribute=None, factoryConfig=None, ): - if factoryConfig is None: factoryConfig = globals()["factoryConfig"] @@ -579,7 +577,6 @@ def __init__( client_group_sign, factoryConfig=None, ): - if factoryConfig is None: factoryConfig = globals()["factoryConfig"] @@ -831,7 +828,6 @@ def clean_glidein_queue( log=logSupport.log, factoryConfig=None, ): - """Cleans up the glideins queue (removes any excesses) per the frontend request. We are not adjusting the glidein totals with what has been removed from the queue. It may take a cycle (or more) @@ -999,7 +995,6 @@ def clean_glidein_queue( def sanitizeGlideins(condorq, log=logSupport.log, factoryConfig=None): - if factoryConfig is None: factoryConfig = globals()["factoryConfig"] @@ -1602,7 +1597,6 @@ def submitGlideins( log=logSupport.log, factoryConfig=None, ): - """Submit the glidein Args: @@ -1717,7 +1711,6 @@ def removeGlideins(schedd_name, jid_list, force=False, log=logSupport.log, facto is_not_first = 0 for jid in jid_list: - # Respect the max_removes limit and exit right away if required if len(removed_jids) >= factoryConfig.max_removes: break # limit reached, stop @@ -1794,7 +1787,6 @@ def get_submit_environment( log=logSupport.log, factoryConfig=None, ): - if factoryConfig is None: factoryConfig = globals()["factoryConfig"] @@ -2208,7 +2200,6 @@ class GlideinTotals: """Keeps track of all glidein totals.""" def __init__(self, entry_name, frontendDescript, jobDescript, entry_condorQ, log=logSupport.log): - # Initialize entry limits self.entry_name = entry_name self.entry_max_glideins = int(jobDescript.data["PerEntryMaxGlideins"]) @@ -2255,7 +2246,7 @@ def __init__(self, entry_name, frontendDescript, jobDescript, entry_condorQ, log ("PerFrontendMaxHeld", "max_held"), ) - for (jd_key, max_glideinstatus_key) in limits_keynames: + for jd_key, max_glideinstatus_key in limits_keynames: fe_glideins_param = jobDescript.data[jd_key] if fe_glideins_param.find(";") != -1: diff --git a/factory/glideFactoryMonitorAggregator.py b/factory/glideFactoryMonitorAggregator.py index 05f2a04ce..577db8c1c 100644 --- a/factory/glideFactoryMonitorAggregator.py +++ b/factory/glideFactoryMonitorAggregator.py @@ -909,7 +909,6 @@ def aggregateRRDStats(log=logSupport.log): tab = xmlFormat.DEFAULT_TAB for rrd in rrdstats_relname: - # assigns the data from every site to 'stats' stats = {} for entry in monitorAggregatorConfig.entries: diff --git a/factory/glideFactoryMonitoring.py b/factory/glideFactoryMonitoring.py index 62a055a8f..505e62e8f 100644 --- a/factory/glideFactoryMonitoring.py +++ b/factory/glideFactoryMonitoring.py @@ -279,6 +279,7 @@ def write_rrd_multi_hetero(self, relative_fname, ds_desc_dict, time, val_dict): # ####################################################################################################################### + # TODO: ['Downtime'] is added to the self.data[client_name] dictionary only if logRequest is called before logSchedd, logClientMonitor # This is inconsistent and should be changed, Redmine [#17244] class condorQStats: @@ -1244,7 +1245,6 @@ def get_xml_updated(self, indent_tab=xmlFormat.DEFAULT_TAB, leading_tab=""): return xmlFormat.time2xml(self.updated, "updated", indent_tab, leading_tab) def write_file(self, monitoringConfig=None): - if monitoringConfig is None: monitoringConfig = globals()["monitoringConfig"] @@ -1492,7 +1492,8 @@ def fetchData(self, rrd_file, pathway, res, start, end): rrdtool fetch returns 3 tuples: a[0], a[1], & a[2]. [0] lists the resolution, start and end time, which can be specified as arugments of fetchData. [1] returns the names of the datasets. These names are listed in the key. - [2] is a list of tuples. each tuple contains data from every dataset. There is a tuple for each time data was collected.""" + [2] is a list of tuples. each tuple contains data from every dataset. There is a tuple for each time data was collected. + """ # use rrdtool to fetch data baseRRDSupport = rrdSupport.rrdSupport() @@ -1810,6 +1811,7 @@ def writeFile(self, path, xml_str, singleEntry=False): ############### P R I V A T E ################ + ################################################## def getAllJobTypes(): return ("validation", "idle", "badput", "nosuccess") diff --git a/factory/manageFactoryDowntimes.py b/factory/manageFactoryDowntimes.py index 1714a7758..d65d9b335 100755 --- a/factory/manageFactoryDowntimes.py +++ b/factory/manageFactoryDowntimes.py @@ -281,7 +281,6 @@ def vacuum(entry_or_id, opt_dict): def get_production_ress_entries(server, ref_dict_list): - production_entries = [] condor_obj = condorMonitor.CondorStatus(pool_name=server) diff --git a/factory/tools/analyze_entries b/factory/tools/analyze_entries index cde112a38..8a2e105fc 100755 --- a/factory/tools/analyze_entries +++ b/factory/tools/analyze_entries @@ -21,7 +21,6 @@ sys.path.append(os.path.join(STARTUP_DIR, "../../..")) def frontend_print(frontend, fe_mode, d, div, to_be_printed, fe_sorting, fe_attr_list, fe_sort_attribute): - fdiv = 1 if fe_attr_list[fe_sort_attribute] in ["total_time", "val", "used", "idle", "waste", "badput"]: fdiv = float(div) @@ -222,7 +221,6 @@ def lineprint(entry_name, entry, g_entry, g, to_be_printed, attr_list, sort_attr def main(): - usage = """ USAGE: -x [#] : interval to do verbose stats (default 24) @@ -416,15 +414,12 @@ USAGE: sys.exit(1) for entry in c_data["entries"]: - for frontend in c_data["entries"][entry]["frontends"]: - if filter_frontend != 0: if frontend != filter_frontend: continue for period in c_data["entries"][entry]["frontends"][frontend]["periods"]: - if int(period) not in data: data[int(period)] = {} if frontend not in data[int(period)]: @@ -601,7 +596,6 @@ Glidein log analysis for frontend %s - %s ################################################################################ if filter_frontend == 0 and frontend_mode == 0: - print( """ --------------------------------------- @@ -617,7 +611,6 @@ Per Entry (all frontends) stats for the past %s hours.\n""" totals_to_be_printed = [] for entry_name, entry in entry_data_all_frontends[period].items(): - if entry["glideins"] == 0 or entry["total_time"] == 0: continue if entry["validation"] == 0: diff --git a/factory/tools/analyze_frontends b/factory/tools/analyze_frontends index f8236f19f..f354579aa 100755 --- a/factory/tools/analyze_frontends +++ b/factory/tools/analyze_frontends @@ -22,7 +22,6 @@ sys.path.append(os.path.join(STARTUP_DIR, "../../..")) def list_print(frontend, zero_supp, entry_data, sorting, attr_list, sort_attribute, div): - to_be_printed = [] sum2 = 0 @@ -105,7 +104,6 @@ def list_print(frontend, zero_supp, entry_data, sorting, attr_list, sort_attribu def main(): - usage = """ USAGE: -x [#] : interval to do verbose stats (default 24) @@ -276,14 +274,12 @@ USAGE: for entry in rrd_data["entries"]: for frontend in rrd_data["entries"][entry]["frontends"]: - # if filtering, only choose selected frontend if filter_frontend != 0: if frontend != filter_frontend: continue for period, elements in rrd_data["entries"][entry]["frontends"][frontend]["periods"].items(): - if int(period) not in data: data[int(period)] = {} if frontend not in data[int(period)]: @@ -379,7 +375,6 @@ Status Attributes (Clients) analysis for %s - %s period_list = [period] for period in period_list: - title = "Past %.1f hours" % (float(period) / 3600) print( diff --git a/factory/tools/analyze_queues b/factory/tools/analyze_queues index ffcb96277..55a139c0c 100755 --- a/factory/tools/analyze_queues +++ b/factory/tools/analyze_queues @@ -22,7 +22,6 @@ sys.path.append(os.path.join(STARTUP_DIR, "../../..")) def list_print(frontend, zero_supp, entry_data, sorting, attr_list, sort_attribute, div): - to_be_printed = [] sum2 = 0 @@ -108,7 +107,6 @@ def list_print(frontend, zero_supp, entry_data, sorting, attr_list, sort_attribu def main(): - usage = """ USAGE: -x [#] : interval to do verbose stats (default 24) @@ -288,14 +286,12 @@ USAGE: for entry in rrd_data["entries"]: for frontend in rrd_data["entries"][entry]["frontends"]: - # if filtering, only choose selected frontend if filter_frontend != 0: if frontend != filter_frontend: continue for period, elements in rrd_data["entries"][entry]["frontends"][frontend]["periods"].items(): - if int(period) not in data: data[int(period)] = {} if frontend not in data[int(period)]: @@ -394,7 +390,6 @@ Status Attributes analysis for %s - %s period_list = [period] for period in period_list: - title = "Past %.1f hours" % (float(period) / 3600) p = period_data[period] status_total = ( diff --git a/factory/tools/cat_logs.py b/factory/tools/cat_logs.py index 6a171c173..55088b8a3 100755 --- a/factory/tools/cat_logs.py +++ b/factory/tools/cat_logs.py @@ -28,6 +28,7 @@ USAGE = "Usage: cat_logs.py YY/MM/DD [hh:mm:ss]" + # return a GlideinDescript with # factory_dir, date_arr and time_arr def parse_args(): diff --git a/factory/tools/find_StartdLogs.py b/factory/tools/find_StartdLogs.py index 10a7885d7..5f64b5240 100755 --- a/factory/tools/find_StartdLogs.py +++ b/factory/tools/find_StartdLogs.py @@ -29,6 +29,7 @@ USAGE = "Usage: find_StartdLogs.py YY/MM/DD [hh:mm:ss]" + # return a GlideinDescript with # factory_dir, date_arr and time_arr def parse_args(): diff --git a/factory/tools/find_logs.py b/factory/tools/find_logs.py index 934a1d665..bc8bf20fa 100755 --- a/factory/tools/find_logs.py +++ b/factory/tools/find_logs.py @@ -30,6 +30,7 @@ USAGE = "Usage: find_logs.py YY/MM/DD [hh:mm:ss]" + # return a GlideinDescript with # factory_dir, date_arr and time_arr def parse_args(): diff --git a/factory/tools/lib/analyze.py b/factory/tools/lib/analyze.py index e06b9ab67..e273cbe87 100644 --- a/factory/tools/lib/analyze.py +++ b/factory/tools/lib/analyze.py @@ -21,7 +21,6 @@ # Example: km(123456) returns "123 K" # and km(1234567) returns "1.23 M" def km(z): - if z < 0: neg = "-" else: diff --git a/frontend/glideinFrontend.py b/frontend/glideinFrontend.py index 4bf3fe292..588d637ec 100755 --- a/frontend/glideinFrontend.py +++ b/frontend/glideinFrontend.py @@ -114,6 +114,7 @@ def poll_group_process(group_name, child): ############################################################ + # return the list of (group,walltime) pairs def spawn_iteration(work_dir, frontendDescript, groups, max_active, failure_dict, max_failures, action): childs = {} @@ -327,14 +328,12 @@ def spawn( logSupport.log.info("Frontend started with mode = %s" % mode) try: - # Service will exit on signal only. # This infinite loop is for the slave to go back into hibernation # once the master becomes alive. # Master never loops infinitely here, but instead it does in # the inner loop while(mode=='master') ... while True: - while hibernate: # If I am slave enter hibernation cycle while Master is alive logSupport.log.info("Master Frontend %s is online. Hibernating." % master_frontend_name) diff --git a/frontend/glideinFrontendConfig.py b/frontend/glideinFrontendConfig.py index e5a1ba008..78b437f1d 100644 --- a/frontend/glideinFrontendConfig.py +++ b/frontend/glideinFrontendConfig.py @@ -61,6 +61,7 @@ def get_group_dir(base_dir, group_name): # ############################################################ + # loads a file or URL composed of # NAME VAL # and creates @@ -252,6 +253,7 @@ def split_func(self, line, convert_function): # ############################################################ + # not everything is merged # the old element can still be accessed class ElementMergedDescript: diff --git a/frontend/glideinFrontendDowntimeLib.py b/frontend/glideinFrontendDowntimeLib.py index e13000426..16e951fe6 100644 --- a/frontend/glideinFrontendDowntimeLib.py +++ b/frontend/glideinFrontendDowntimeLib.py @@ -50,6 +50,7 @@ def read(self, raise_on_error=False): # INTERNAL - Do not use ############################# + # return a list of downtime periods (utimes) # a value of None idicates "forever" # for example: [(1215339200,1215439170),(1215439271,None)] @@ -116,7 +117,6 @@ def checkDowntime(fname, check_time=None): time_list = read(fname) for time_tuple in time_list: - if check_time < time_tuple[0]: # check_time before start continue @@ -155,7 +155,6 @@ def addPeriod(fname, start_time, end_time, create_if_empty=True): # end a downtime (not a scheduled one) # if end_time==None, use current time def endDowntime(fname, end_time=None): - if end_time is None: end_time = int(time.time()) diff --git a/frontend/glideinFrontendElement.py b/frontend/glideinFrontendElement.py index 80bdd36fb..d9f8d1c50 100755 --- a/frontend/glideinFrontendElement.py +++ b/frontend/glideinFrontendElement.py @@ -1421,7 +1421,6 @@ def compute_glidein_min_idle( or (global_total_glideins >= self.global_total_max_glideins) or (global_total_idle_glideins >= self.global_total_max_vms_idle) ): - # Do not request more glideins under following conditions: # 1. Have all the running jobs I wanted # 2. Have enough idle vms/slots @@ -1528,7 +1527,6 @@ def identify_limits_triggered( global_total_idle_glideins, limits_triggered, ): - # Identify the limits triggered for advertizing in glideresource if count_status["Total"] >= self.max_running: limits_triggered["TotalGlideinsPerEntry"] = "count=%i, limit=%i" % (count_status["Total"], self.max_running) @@ -2083,7 +2081,6 @@ def get_condor_q(self, schedd_name): return condorq_dict def get_condor_status(self): - # All slots for this group status_dict = {} fe_counts = {"Idle": 0, "Total": 0} diff --git a/frontend/glideinFrontendInterface.py b/frontend/glideinFrontendInterface.py index d9e33426d..3b1c856c9 100644 --- a/frontend/glideinFrontendInterface.py +++ b/frontend/glideinFrontendInterface.py @@ -264,7 +264,7 @@ def format_condor_dict(data): del kel[attr] # then move the parameters and monitoring - for (prefix, eldata) in ( + for prefix, eldata in ( (frontendConfig.glidein_param_prefix, el["params"]), (frontendConfig.glidein_monitor_prefix, el["monitor"]), ): @@ -802,7 +802,6 @@ def add( auth_method="Any", ha_mode="master", ): - params_obj = AdvertizeParams( request_name, glidein_name, @@ -1342,7 +1341,7 @@ def createAdvertizeWorkFile(self, factory_pool, params_obj, key_obj=None, file_i (frontendConfig.encrypted_param_prefix, encrypted_params), (frontendConfig.glidein_config_prefix, self.glidein_config_limits), ) - for (prefix, data) in classad_info_tuples: + for prefix, data in classad_info_tuples: for attr in list(data.keys()): writeTypedClassadAttrToFile(fd, f"{prefix}{attr}", data[attr]) diff --git a/frontend/glideinFrontendLib.py b/frontend/glideinFrontendLib.py index a3d218fc5..4f5c5438d 100644 --- a/frontend/glideinFrontendLib.py +++ b/frontend/glideinFrontendLib.py @@ -783,7 +783,6 @@ def getCondorStatusNonDynamic(status_dict): def getIdleCondorStatus(status_dict): out = {} for collector_name in list(status_dict.keys()): - # Exclude partitionable slots with no free memory/cpus # Minimum memory required by CMS is 2500 MB # If the node had GPUs, there should be at least one available (requested by CMS) @@ -1236,6 +1235,7 @@ def getCondorStatusSchedds(collector_names, constraint=None, format_list=None, w # ############################################################ + # # Return a dictionary of schedds containing jobs of a certain type # Each element is a condorQ diff --git a/frontend/glideinFrontendMonitoring.py b/frontend/glideinFrontendMonitoring.py index e3be22a13..8f2ecf52d 100644 --- a/frontend/glideinFrontendMonitoring.py +++ b/frontend/glideinFrontendMonitoring.py @@ -657,6 +657,7 @@ def write_file(self): ############### P R I V A T E ################ + ################################################## def tmp2final(fname): """ diff --git a/frontend/tools/glidein_off b/frontend/tools/glidein_off index 7b0ccf4b2..b01c365a7 100755 --- a/frontend/tools/glidein_off +++ b/frontend/tools/glidein_off @@ -199,6 +199,7 @@ def lookup_addrs(constr): ############################################################################# TP_FAIL = False + # thrad callback def run_off(addr, off_type): global TP_FAIL diff --git a/lib/condorMonitor.py b/lib/condorMonitor.py index 45cdba314..d7aa80deb 100644 --- a/lib/condorMonitor.py +++ b/lib/condorMonitor.py @@ -67,6 +67,7 @@ def htcondor_full_reload(): # Configuration # + # Set path to condor binaries def set_path(new_condor_bin_path): global condor_bin_path @@ -849,6 +850,7 @@ def getHash(self, hash_func): # ############################################################ + # check that req_format_els are present in in_format_list, and if not add them # return a new format_list def complete_format_list(in_format_list, req_format_els): @@ -890,6 +892,7 @@ def complete_format_list(in_format_list, req_format_els): # # + # 3 xml2list XML handler functions def xml2list_start_element(name, attrs): global xml2list_data, xml2list_inclassad, xml2list_inattr, xml2list_intype diff --git a/lib/config_util.py b/lib/config_util.py index 711a1b871..ec46180da 100644 --- a/lib/config_util.py +++ b/lib/config_util.py @@ -273,7 +273,7 @@ def update(data, update_data, overwrite=True): if value is None: if key in data: del data[key] - elif isinstance(value, collections.Mapping): + elif isinstance(value, collections.abc.Mapping): sub_data = data.get(key, {}) if sub_data is not None: data[key] = update(sub_data, value, overwrite) diff --git a/lib/fork.py b/lib/fork.py index e49c93c4a..e66a35b08 100644 --- a/lib/fork.py +++ b/lib/fork.py @@ -356,7 +356,6 @@ def fork_and_collect(self): return results def bounded_fork_and_collect(self, max_forks, log_progress=True, sleep_time=0.01): - post_work_info = {} nr_errors = 0 diff --git a/lib/pidSupport.py b/lib/pidSupport.py index c35feb04b..a3aa8bcb6 100644 --- a/lib/pidSupport.py +++ b/lib/pidSupport.py @@ -22,6 +22,7 @@ ############################################################ + # # Verify if the system knows about a pid # @@ -31,6 +32,7 @@ def check_pid(pid): ############################################################ + # this exception is raised when trying to register a pid # but another process is already owning the PID file class AlreadyRunning(RuntimeError): diff --git a/lib/timeConversion.py b/lib/timeConversion.py index 930c71a85..10fd77715 100644 --- a/lib/timeConversion.py +++ b/lib/timeConversion.py @@ -104,6 +104,7 @@ def get_time_in_format(now=None, time_format=None): # Internal ######################### + # time.daylight tells only if the computer support daylight saving time, # tm_isdst must be checked to see if it is in effect at time t # Some corner cases (changes in standard) are still uncovered, see https://bugs.python.org/issue1647654 diff --git a/lib/xmlParse.py b/lib/xmlParse.py index 2da431995..c32d7300a 100644 --- a/lib/xmlParse.py +++ b/lib/xmlParse.py @@ -97,7 +97,6 @@ def values(self): def xmlfile2dict( fname, use_ord_dict=False, always_singular_list=[] # if true, return OrderedDict instead of a regular dictionary ): # anything id listed here will be considered as a list - try: doc = xml.dom.minidom.parse(fname) except xml.parsers.expat.ExpatError as e: diff --git a/tools/lib/glideinCmd.py b/tools/lib/glideinCmd.py index 702c3156f..2eb1bf213 100644 --- a/tools/lib/glideinCmd.py +++ b/tools/lib/glideinCmd.py @@ -92,6 +92,7 @@ def exe_cmd_script(argv_func, argv=sys.argv): # INTERNAL - Do not use directly ###################################### + # create a file usable by a callback function for glideinMonitor.monitor def monitorScriptFromList(monitor_file_name, monitor_control_relname, script_list): # create the command file @@ -118,7 +119,6 @@ def argv2cmd(argv): # callback function for glideinMonitor.monitor # changes to the work dir and executes the command def createCmdMonitorFile(monitor_file_name, monitor_control_relname, argv, condor_status, monitorVM): - script_lines = [] # find work dir and execute command there # TODO: consider possible different directory for singularity jobs diff --git a/unittests/test_creation_lib_cWDictFile_DictFileTwoKeys.py b/unittests/test_creation_lib_cWDictFile_DictFileTwoKeys.py index 160535cfc..ca0838cca 100755 --- a/unittests/test_creation_lib_cWDictFile_DictFileTwoKeys.py +++ b/unittests/test_creation_lib_cWDictFile_DictFileTwoKeys.py @@ -168,7 +168,6 @@ def test_is_equal(self): ) def test_parse_val(self): - line = """foo 'bar'""" self.dict_file.parse_val(line) cpy = copy.deepcopy(self.dict_file) diff --git a/unittests/test_creation_lib_cgWDictFile.py b/unittests/test_creation_lib_cgWDictFile.py index 404804b60..46a29861b 100755 --- a/unittests/test_creation_lib_cgWDictFile.py +++ b/unittests/test_creation_lib_cgWDictFile.py @@ -65,6 +65,7 @@ XML_ENTRY = "fixtures/factory/config.d/Dev_Sites.xml" XML_ENTRY2 = "fixtures/factory/config.d/Dev_Sites2.xml" + # pylint: disable=maybe-no-member # class TestMonitorGroupDictFile(unittest.TestCase): class TestcgWDictFile(unittest.TestCase): diff --git a/unittests/test_creation_lib_cvWCreate.py b/unittests/test_creation_lib_cvWCreate.py index 89fe2fdaa..983866d77 100755 --- a/unittests/test_creation_lib_cvWCreate.py +++ b/unittests/test_creation_lib_cvWCreate.py @@ -66,7 +66,6 @@ def test_create_client_mapfile(self): os.remove(mapfile_fname) def test_get_template(self): - # test that we can fetch an existing template glideinWMS_dir = ".." template_name = "gwms-factory.service" diff --git a/unittests/test_factory_glideFactoryLib.py b/unittests/test_factory_glideFactoryLib.py index 258d7c366..7bff2b396 100755 --- a/unittests/test_factory_glideFactoryLib.py +++ b/unittests/test_factory_glideFactoryLib.py @@ -288,7 +288,6 @@ def test_is_str_safe(self): self.assertTrue(is_str_safe(s2)) def test_env_list2dict(self): - env = ["a=b", "c=d"] expected = {"a": "b", "c": "d"} self.assertEqual(expected, env_list2dict(env)) diff --git a/unittests/test_frontend.py b/unittests/test_frontend.py index 466a83538..9d2aa73e9 100755 --- a/unittests/test_frontend.py +++ b/unittests/test_frontend.py @@ -129,7 +129,6 @@ def setUp(self): def test_countMatch_missingKey(self): with mock.patch.object(glideinwms.frontend.glideinFrontendLib.logSupport.log, "debug") as m_debug: - match_obj = compile('glidein["attrs"]["FOO"] == 3', "", "eval") match_counts = glideinFrontendLib.countMatch(match_obj, self.condorq_dict, self.glidein_dict, {}, False) m_debug.assert_called_with( diff --git a/unittests/test_lib_xmlParse.py b/unittests/test_lib_xmlParse.py index 5f96cdf38..8e93f8f62 100755 --- a/unittests/test_lib_xmlParse.py +++ b/unittests/test_lib_xmlParse.py @@ -119,7 +119,6 @@ def test_update(self): self.assertTrue("foo" in ordered_dict) def test_values(self): - dict1 = xmlstring2dict(xmlstr, use_ord_dict=False, always_singular_list=[]) ordered_dict = OrderedDict(dict1) self.assertEqual(ordered_dict_values_repr, list(ordered_dict.values()).__repr__()) @@ -158,7 +157,6 @@ def test_get_xml_attributes(self): class TestIsSingularOf(unittest.TestCase): def test_is_singular_of(self): - self.assertEqual(True, is_singular_of(mysin="dog", myplu="dogs", always_singular_list=[])) self.assertEqual(True, is_singular_of(mysin="goose", myplu="geese", always_singular_list=["goose", "dog"])) self.assertEqual(False, is_singular_of(mysin="moose", myplu="meese", always_singular_list=["goose", "dog"]))