diff --git a/eccs2.py b/eccs2.py index 61852675c3137a91263f5a8c93beca80a5fc2e09..ca974b897700282e88eaa3cf6d0c1e921ee094fc 100755 --- a/eccs2.py +++ b/eccs2.py @@ -5,16 +5,10 @@ import datetime import json import re import requests -import time from eccs2properties import DAY, ECCS2HTMLDIR, ECCS2OUTPUTDIR, ECCS2RESULTSLOG, ECCS2CHECKSLOG, FEDS_BLACKLIST, IDPS_BLACKLIST, ECCS2SPS, ECCS2SELENIUMDEBUG from pathlib import Path -from selenium.webdriver.common.by import By -from selenium.webdriver.common.keys import Keys -from selenium.webdriver.support.ui import Select, WebDriverWait -from selenium.webdriver.support import expected_conditions as EC -from selenium.common.exceptions import NoSuchElementException, TimeoutException, WebDriverException, UnexpectedAlertPresentException -from urllib3.exceptions import MaxRetryError +from selenium.common.exceptions import TimeoutException from urllib3.util import parse_url from utils import getLogger, getIdPContacts, getDriver @@ -102,14 +96,6 @@ def checkIdP(sp,idp,test): print("[page_source of %s]\nNo source code" % (fqdn_idp)) return (idp['entityID'],wayfless_url,check_time,"(failed)","Timeout") - except NoSuchElementException as e: - # The input of the bootstrap tables are provided by "eccs2" and "eccs2checks" log. - # If I don't return anything and I don't put anything in the logger - # I'll not write on the input files for the table - # and I can re-run the command that caused the exception from the "stdout.log" file. - print("!!! NO SUCH ELEMENT EXCEPTION - RUN AGAIN THE COMMAND !!!") - return None - except Exception as e: print ("!!! EXCEPTION !!!") print (e.__str__()) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1bb6041a579846552a98ff32e3a146313e4b9739 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +urllib3==1.25.9 +Flask==1.1.2 +Flask_RESTful==0.3.8 +requests==2.23.0 +selenium==3.141.0 diff --git a/runEccs2.py b/runEccs2.py index f953652e5fabacee8e5f4a05917676c5e01fec49..ed85b5fa0f467eab34cb2e0716c2ec50975e54ff 100755 --- a/runEccs2.py +++ b/runEccs2.py @@ -9,7 +9,7 @@ import time from utils import getListFeds, getListEccsIdps, getRegAuthDict, getIdpList from eccs2properties import ECCS2FAILEDCMD, ECCS2FAILEDCMDIDP, ECCS2STDOUT, ECCS2STDERR, ECCS2STDOUTIDP, ECCS2STDERRIDP, ECCS2DIR, ECCS2NUMPROCESSES, ECCS2LISTIDPSURL, ECCS2LISTIDPSFILE, ECCS2LISTFEDSURL, ECCS2LISTFEDSFILE -from subprocess import Popen,PIPE +from subprocess import PIPE # Run Command @@ -87,18 +87,16 @@ if __name__=="__main__": dest_file = ECCS2LISTIDPSFILE list_eccs_idps = getListEccsIdps(url, dest_file) - if (args.idp_entityid[0]): + if (args.idp_entityid): stdout_file = open(ECCS2STDOUTIDP,"w+") stderr_file = open(ECCS2STDERRIDP,"w+") cmd_file = open(ECCS2FAILEDCMDIDP,"w+") idpJsonList = getIdpList(list_eccs_idps,idp_entityid=args.idp_entityid[0]) - if (args.test): - cmd = "%s/eccs2.py \'%s\' --test" % (ECCS2DIR,json.dumps(idpJsonList[0])) - print(cmd) - else: + if (args.test is not True): cmd = "%s/eccs2.py \'%s\'" % (ECCS2DIR,json.dumps(idpJsonList[0])) - print(cmd) + else: + cmd = "%s/eccs2.py \'%s\' --test" % (ECCS2DIR,json.dumps(idpJsonList[0])) proc_list = [cmd] asyncio.run(main(proc_list,stdout_file,stderr_file,cmd_file)) @@ -115,7 +113,7 @@ if __name__=="__main__": idpJsonList = getIdpList(list_eccs_idps,regAuth) num_idps = len(idpJsonList) - if (arg.test is not True): + if (args.test is not True): cmd_list = [["%s/eccs2.py \'%s\'" % (ECCS2DIR, json.dumps(idp))] for idp in idpJsonList] else: cmd_list = [["%s/eccs2.py \'%s\' --test" % (ECCS2DIR, json.dumps(idp))] for idp in idpJsonList]