Skip to content

Commit

Permalink
timesanitycheck and bootclockrandomization check with dpkg-query
Browse files Browse the repository at this point in the history
  • Loading branch information
troubadoour committed Aug 15, 2015
1 parent 5179a0b commit 30ceaa0
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions usr/lib/python2.7/dist-packages/sdwdate_gui/sdwdate_gui.py
Expand Up @@ -64,6 +64,7 @@ def __init__(self, parent=None):
self.right_click_menu = RightClickMenu()
self.setContextMenu(self.right_click_menu)

self.check_timesanitycheck()
self.check_bootclockrandomization()

self.path = '/var/run/sdwdate'
Expand Down Expand Up @@ -115,13 +116,24 @@ def watch_folder(self):
self.watcher = watcher([self.status_path])
self.watcher.fileChanged.connect(self.status_changed)

def check_timesanitycheck(self):
try:
status = check_output(['dpkg-query',
'--show',
"--showformat='${db:Status-Abbrev}'",
"timesanitycheck"])
except subprocess.CalledProcessError as e:
message = 'timesanitycheck is not installed'
print message

def check_bootclockrandomization(self):
try:
status = check_output(['systemctl',
'status',
'bootclockrandomization'])
except subprocess.CalledProcessError:
message = 'bootclockrandomization failed.'
status = check_output(['dpkg-query',
'--show',
"--showformat='${db:Status-Abbrev}'",
"bootclockrandomization"])
except subprocess.CalledProcessError as e:
message = 'bootclockrandomization is not installed'
print message


Expand Down

0 comments on commit 30ceaa0

Please sign in to comment.