Skip to content
Snippets Groups Projects
Commit 4ea90da6 authored by Marco Malavolti's avatar Marco Malavolti
Browse files

Small fixes

parent 8aece9f0
No related branches found
No related tags found
No related merge requests found
...@@ -5,16 +5,10 @@ import datetime ...@@ -5,16 +5,10 @@ import datetime
import json import json
import re import re
import requests import requests
import time
from eccs2properties import DAY, ECCS2HTMLDIR, ECCS2OUTPUTDIR, ECCS2RESULTSLOG, ECCS2CHECKSLOG, FEDS_BLACKLIST, IDPS_BLACKLIST, ECCS2SPS, ECCS2SELENIUMDEBUG from eccs2properties import DAY, ECCS2HTMLDIR, ECCS2OUTPUTDIR, ECCS2RESULTSLOG, ECCS2CHECKSLOG, FEDS_BLACKLIST, IDPS_BLACKLIST, ECCS2SPS, ECCS2SELENIUMDEBUG
from pathlib import Path from pathlib import Path
from selenium.webdriver.common.by import By from selenium.common.exceptions import TimeoutException
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 urllib3.util import parse_url from urllib3.util import parse_url
from utils import getLogger, getIdPContacts, getDriver from utils import getLogger, getIdPContacts, getDriver
...@@ -102,14 +96,6 @@ def checkIdP(sp,idp,test): ...@@ -102,14 +96,6 @@ def checkIdP(sp,idp,test):
print("[page_source of %s]\nNo source code" % (fqdn_idp)) print("[page_source of %s]\nNo source code" % (fqdn_idp))
return (idp['entityID'],wayfless_url,check_time,"(failed)","Timeout") 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: except Exception as e:
print ("!!! EXCEPTION !!!") print ("!!! EXCEPTION !!!")
print (e.__str__()) print (e.__str__())
......
urllib3==1.25.9
Flask==1.1.2
Flask_RESTful==0.3.8
requests==2.23.0
selenium==3.141.0
...@@ -9,7 +9,7 @@ import time ...@@ -9,7 +9,7 @@ import time
from utils import getListFeds, getListEccsIdps, getRegAuthDict, getIdpList from utils import getListFeds, getListEccsIdps, getRegAuthDict, getIdpList
from eccs2properties import ECCS2FAILEDCMD, ECCS2FAILEDCMDIDP, ECCS2STDOUT, ECCS2STDERR, ECCS2STDOUTIDP, ECCS2STDERRIDP, ECCS2DIR, ECCS2NUMPROCESSES, ECCS2LISTIDPSURL, ECCS2LISTIDPSFILE, ECCS2LISTFEDSURL, ECCS2LISTFEDSFILE 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 # Run Command
...@@ -87,18 +87,16 @@ if __name__=="__main__": ...@@ -87,18 +87,16 @@ if __name__=="__main__":
dest_file = ECCS2LISTIDPSFILE dest_file = ECCS2LISTIDPSFILE
list_eccs_idps = getListEccsIdps(url, dest_file) list_eccs_idps = getListEccsIdps(url, dest_file)
if (args.idp_entityid[0]): if (args.idp_entityid):
stdout_file = open(ECCS2STDOUTIDP,"w+") stdout_file = open(ECCS2STDOUTIDP,"w+")
stderr_file = open(ECCS2STDERRIDP,"w+") stderr_file = open(ECCS2STDERRIDP,"w+")
cmd_file = open(ECCS2FAILEDCMDIDP,"w+") cmd_file = open(ECCS2FAILEDCMDIDP,"w+")
idpJsonList = getIdpList(list_eccs_idps,idp_entityid=args.idp_entityid[0]) idpJsonList = getIdpList(list_eccs_idps,idp_entityid=args.idp_entityid[0])
if (args.test): if (args.test is not True):
cmd = "%s/eccs2.py \'%s\' --test" % (ECCS2DIR,json.dumps(idpJsonList[0]))
print(cmd)
else:
cmd = "%s/eccs2.py \'%s\'" % (ECCS2DIR,json.dumps(idpJsonList[0])) 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] proc_list = [cmd]
asyncio.run(main(proc_list,stdout_file,stderr_file,cmd_file)) asyncio.run(main(proc_list,stdout_file,stderr_file,cmd_file))
...@@ -115,7 +113,7 @@ if __name__=="__main__": ...@@ -115,7 +113,7 @@ if __name__=="__main__":
idpJsonList = getIdpList(list_eccs_idps,regAuth) idpJsonList = getIdpList(list_eccs_idps,regAuth)
num_idps = len(idpJsonList) 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] cmd_list = [["%s/eccs2.py \'%s\'" % (ECCS2DIR, json.dumps(idp))] for idp in idpJsonList]
else: else:
cmd_list = [["%s/eccs2.py \'%s\' --test" % (ECCS2DIR, json.dumps(idp))] for idp in idpJsonList] cmd_list = [["%s/eccs2.py \'%s\' --test" % (ECCS2DIR, json.dumps(idp))] for idp in idpJsonList]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment