1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from spacewalk.common import rhnFlags
16 from spacewalk.common.rhnLog import log_debug
17 from spacewalk.server.rhnServer import server_kickstart
18
19 __rhnexport__ = ['initiate', 'add_tools_channel', 'schedule_virt_guest_pkg_install']
20
21
22 -def _action(action_name, server_id, action_id, success_state, success_type):
23 log_debug(3, action_name, server_id, action_id)
24
25 action_status = rhnFlags.get('action_status')
26
27 if action_status == 3:
28 ks_state = 'failed'
29 next_action_type = None
30 else:
31 ks_state = success_state
32 next_action_type = success_type
33
34 server_kickstart.update_kickstart_session(server_id, action_id,
35 action_status, kickstart_state=ks_state,
36 next_action_type=next_action_type)
37
38
40 _action('schedule_virt_guest_pkg_install', server_id, action_id,
41 'complete', None)
42
43
47
48
49 -def initiate(server_id, action_id, data={}):
50 _action('initiate', server_id, action_id,
51 'in_progress', 'kickstart_guest.add_tools_channel')
52