Commit f433b8e2 authored by Łukasz Nowak's avatar Łukasz Nowak

XXX

parent 617fb154
...@@ -7,6 +7,7 @@ import requests ...@@ -7,6 +7,7 @@ import requests
import sys import sys
import time import time
import zc.lockfile import zc.lockfile
import subprocess
class Updater(object): class Updater(object):
...@@ -67,7 +68,8 @@ class Updater(object): ...@@ -67,7 +68,8 @@ class Updater(object):
print('Certificate %r: %r is empty' % (certificate_file, url,)) print('Certificate %r: %r is empty' % (certificate_file, url,))
return certificate return certificate
def updateCertificate(self, certificate_file, master_content=None): def updateCertificate(self, certificate_file, master_content=None,
validator=None):
url, fallback_file = self.mapping[certificate_file] url, fallback_file = self.mapping[certificate_file]
certificate = self.fetchCertificate(url, certificate_file) certificate = self.fetchCertificate(url, certificate_file)
...@@ -104,6 +106,9 @@ class Updater(object): ...@@ -104,6 +106,9 @@ class Updater(object):
else: else:
self.state_dict[certificate_file] = {'overridden': True} self.state_dict[certificate_file] = {'overridden': True}
if validator is not None and master_content:
# In case if it is not master certificate do the validation
subprocess.run(validator)
if current != certificate: if current != certificate:
with open(certificate_file, 'w') as fh: with open(certificate_file, 'w') as fh:
fh.write(certificate) fh.write(certificate)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment