/[gli]/trunk/src/net/client/gliclient.py
Gentoo

Diff of /trunk/src/net/client/gliclient.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 939 Revision 940
25 else: 25 else:
26 raise GLIException("NetFeError", 'fatal', 'setup_network',"Was unable to find a network inferface.") 26 raise GLIException("NetFeError", 'fatal', 'setup_network',"Was unable to find a network inferface.")
27 return device[0], device[1] 27 return device[0], device[1]
28 28
29def find_server(): 29def find_server():
30 device = None
31 for dev in GLIUtility.get_eth_devices():
32 if dev.startswith("eth"):
33 device = GLIUtility.get_eth_info(dev)
34 break
35 else:
36 return False
37
38 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 30 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
39 s.bind(('', 0)) 31 s.bind(('', 0))
40 s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) 32 s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
41 s.settimeout(15) 33 s.settimeout(15)
42 34
101 tmpfile = open("/tmp/install_profile.xml", "w") 93 tmpfile = open("/tmp/install_profile.xml", "w")
102 tmpfile.write(install_profile) 94 tmpfile.write(install_profile)
103 tmpfile.close() 95 tmpfile.close()
104 96
105 client_config = GLIClientConfiguration.ClientConfiguration() 97 client_config = GLIClientConfiguration.ClientConfiguration()
106 client_config.parse("/tmp/client_config.conf") 98 client_config.parse("/tmp/client_config.xml")
107 install_profile = GLIInstallProfile.InstallProfile() 99 install_profile = GLIInstallProfile.InstallProfile()
108 install_profile.parse("/tmp/install_profile.xml") 100 install_profile.parse("/tmp/install_profile.xml")
109 cc = GLIClientController.GLIClientController(client_config, install_profile) 101 cc = GLIClientController.GLIClientController(client_config, install_profile)
110 102
111 #Start the backend threads 103 #Start the backend threads
112 cc.start_pre_install() 104 cc.start_pre_install()
113 105
114 #Begin the main engine 106 #Begin the main engine
115 cc.start_install() 107 cc.start_install()
116 d.gauge_start("Installation Started!", title="Installation progress")
117 num_steps_completed = 1 108 num_steps_completed = 1
118 while 1: 109 while 1:
119 notification = cc.getNotification() 110 notification = cc.getNotification()
120 if notification == None: 111 if notification == None:
121 time.sleep(1) 112 time.sleep(1)
122 continue 113 continue
123 ntype = notification.get_type() 114 ntype = notification.get_type()
124 ndata = notification.get_data() 115 ndata = notification.get_data()
125 if ntype == "exception": 116 if ntype == "exception":
117 print str(ndata)
126 server.update_client_status(local_mac, "Exception: " + ndata) 118 server.update_client_status(local_mac, "Exception: " + str(ndata))
127 print ndata 119 sys.exit(0)
128 elif ntype == "int": 120 elif ntype == "int":
129 if ndata == GLIClientController.NEXT_STEP_READY: 121 if ndata == GLIClientController.NEXT_STEP_READY:
130 next_step_waiting = False 122 next_step_waiting = False
131 next_step = cc.get_next_step_info() 123 next_step = cc.get_next_step_info()
132 num_steps = cc.get_num_steps() 124 num_steps = cc.get_num_steps()
133 print "Step " + str(num_steps_completed) + " of " + str(num_steps) + ": " + next_step 125 print str(num_steps_completed) + " of " + str(num_steps) + ": " + next_step
134 server.update_client_status(local_mac, "On step " + num_steps_completed + " of " + num_steps + ". Current step: " + next_step) 126 server.update_client_status(local_mac, str(num_steps_completed) + " of " + str(num_steps) + ": " + next_step)
135 num_steps_completed += 1 127 num_steps_completed += 1
136 if cc.has_more_steps(): 128 if cc.has_more_steps():
137 cc.next_step() 129 cc.next_step()
138 continue 130 continue
139 if ndata == GLIClientController.INSTALL_DONE: 131 if ndata == GLIClientController.INSTALL_DONE:

Legend:
Removed from v.939  
changed lines
  Added in v.940

  ViewVC Help
Powered by ViewVC 1.1.20