parsifal: update scripts
This commit is contained in:
parent
71494ad8d4
commit
b37f90c983
|
@ -62,8 +62,8 @@ $ ./validate_basket.py -e dev S10055618250
|
|||
penser à noter les idIns pour ensuite pouvoir faire :
|
||||
$ ./delete_subscribe_activity.py -e dev S10055619138
|
||||
|
||||
'idIns': 'S10055618294'
|
||||
'idIns': 'S10055618298'
|
||||
'idIns': 'S10055620837'
|
||||
'idIns': 'S10055620833'
|
||||
|
||||
Factures
|
||||
........
|
||||
|
|
|
@ -8,12 +8,13 @@ import sys
|
|||
|
||||
import utils
|
||||
|
||||
def check(args):
|
||||
utils.configure_logging(args.verbose)
|
||||
wsdl_url = utils.get_wsdl_url(args.env, args.service)
|
||||
|
||||
def check_one(args, service):
|
||||
wsdl_url = utils.get_wsdl_url(args.env, service)
|
||||
print(wsdl_url)
|
||||
|
||||
# previous result
|
||||
wsdl_file_path = '%sService.wsdl' % args.service.title()
|
||||
wsdl_file_path = '%sService.wsdl' % service.title()
|
||||
if not os.path.exists(wsdl_file_path):
|
||||
with open(wsdl_file_path, 'w'):
|
||||
pass
|
||||
|
@ -33,13 +34,28 @@ def check(args):
|
|||
stdout = stderr = subprocess.PIPE
|
||||
cmd = 'diff %s %s' % (wsdl_file_path, last_wsdl_file_path)
|
||||
output = subprocess.run(cmd, shell=True, check=False, stdout=stdout, stderr=stderr)
|
||||
sys.exit(output.returncode)
|
||||
|
||||
if output.returncode:
|
||||
print('WSDL change on %s' % service)
|
||||
return output.returncode
|
||||
|
||||
|
||||
def check(args):
|
||||
returncode = 0
|
||||
|
||||
utils.configure_logging(args.verbose)
|
||||
if args.service == 'all':
|
||||
for service in ['family', 'activity', 'invoice', 'ape', 'site']:
|
||||
result = check_one(args, service)
|
||||
returncode = returncode or result
|
||||
else:
|
||||
returncode = check_one(args, args.service)
|
||||
sys.exit(returncode)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--verbose', '-v', type=int, default=2, help='display errors')
|
||||
parser.add_argument('--env', '-e', default='integ', help='dev, test, integ, prod')
|
||||
parser.add_argument('service', help='family, activity, invoice or site', nargs='?', default='Family')
|
||||
parser.add_argument('service', help='family, activity, invoice, ape, site or all', nargs='?', default='all')
|
||||
args = parser.parse_args()
|
||||
check(args)
|
||||
|
|
|
@ -47,6 +47,6 @@ if __name__ == "__main__":
|
|||
parser.add_argument('--person', '-P', default=PERSON_ID, help='person id')
|
||||
parser.add_argument('--activity', '-a', default=ACTIVITY_ID, help='activity id')
|
||||
parser.add_argument('--year', '-y', default=YEAR, help='year (ex: 2023)')
|
||||
parser.add_argument('--month', '-m', default=YEAR, help='month (ex: 4)')
|
||||
parser.add_argument('--month', '-m', default=MONTH, help='month (ex: 4)')
|
||||
parser.add_argument('activity', nargs='?', default=None, help='activity id')
|
||||
check(parser.parse_args())
|
||||
|
|
Loading…
Reference in New Issue