Merge update_grub into client

This commit is contained in:
Ian Gulliver
2016-05-10 00:23:04 +00:00
parent 920ea089d0
commit 02b7f46dd2
5 changed files with 15 additions and 57 deletions

View File

@@ -6,10 +6,16 @@ import json
import os
import socket
import time
import update_grub
from ws4py.client import threadedclient
parser = argparse.ArgumentParser(description='iconograph fetcher')
parser.add_argument(
'--boot-dir',
dest='boot_dir',
action='store',
required=True)
parser.add_argument(
'--config',
dest='config',
@@ -95,6 +101,11 @@ class Client(threadedclient.WebSocketClient):
fetch.Fetch()
fetch.DeleteOldImages()
update = update_grub.GrubUpdater(
FLAGS.image_dir,
FLAGS.boot_dir)
update.Update()
def received_message(self, msg):
parsed = json.loads(msg.data.decode('utf8'))
if parsed['type'] == 'image_types':