| Line 82... |
Line 82... |
| 82 |
instance_id = instance.id
|
82 |
instance_id = instance.id
|
| 83 |
name = instance.tags.get("Name", instance_id)
|
83 |
name = instance.tags.get("Name", instance_id)
|
| 84 |
state_code = instance.state_code
|
84 |
state_code = instance.state_code
|
| 85 |
start_hour_gmt = getSetTag(instance, 'START_HOUR_GMT', DEFAULT_START_GMT)
|
85 |
start_hour_gmt = getSetTag(instance, 'START_HOUR_GMT', DEFAULT_START_GMT)
|
| 86 |
stop_hour_gmt = getSetTag(instance, 'STOP_HOUR_GMT', DEFAULT_STOP_GMT)
|
86 |
stop_hour_gmt = getSetTag(instance, 'STOP_HOUR_GMT', DEFAULT_STOP_GMT)
|
| 87 |
action_days = getSetTag(instance, '', DEFAULT_WEEKDAY_ACTION)
|
87 |
action_days = getSetTag(instance, 'ACTION_DAYS', DEFAULT_WEEKDAY_ACTION)
|
| 88 |
|
88 |
|
| 89 |
no_boot_until_time = getTimeFromInstance(instance, 'NO_BOOT_UNTIL', DEFAULT_NO_BOOT_TIME, TAG_DATE_TIME_FORMAT)
|
89 |
no_boot_until_time = getTimeFromInstance(instance, 'NO_BOOT_UNTIL', DEFAULT_NO_BOOT_TIME, TAG_DATE_TIME_FORMAT)
|
| 90 |
no_kill_until_time = getTimeFromInstance(instance, 'NO_KILL_UNTIL', DEFAULT_NO_KILL_TIME, TAG_DATE_TIME_FORMAT)
|
90 |
no_kill_until_time = getTimeFromInstance(instance, 'NO_KILL_UNTIL', DEFAULT_NO_KILL_TIME, TAG_DATE_TIME_FORMAT)
|
| 91 |
last_auto_start_time = getTimeFromInstance(instance, 'LAST_AUTO_START', DEFAULT_AUTO_TIME, TODAY_HOUR_DT_FORMAT)
|
91 |
last_auto_start_time = getTimeFromInstance(instance, 'LAST_AUTO_START', DEFAULT_AUTO_TIME, TODAY_HOUR_DT_FORMAT)
|
| 92 |
last_auto_stop_time = getTimeFromInstance(instance, 'LAST_AUTO_STOP', DEFAULT_AUTO_TIME, TODAY_HOUR_DT_FORMAT)
|
92 |
last_auto_stop_time = getTimeFromInstance(instance, 'LAST_AUTO_STOP', DEFAULT_AUTO_TIME, TODAY_HOUR_DT_FORMAT)
|
| Line 103... |
Line 103... |
| 103 |
elif ( isNoActionDay(action_days, this_day_name) ):
|
103 |
elif ( isNoActionDay(action_days, this_day_name) ):
|
| 104 |
action_taken = "Not modifying non actionable day (" + action_days + ") " + this_day_name
|
104 |
action_taken = "Not modifying non actionable day (" + action_days + ") " + this_day_name
|
| 105 |
else:
|
105 |
else:
|
| 106 |
total_msg = ""
|
106 |
total_msg = ""
|
| 107 |
|
107 |
|
| 108 |
if ( this_hour_time <= no_kill_until_time ):
|
108 |
if ( this_hour_time <= no_boot_until_time ):
|
| 109 |
total_msg += no_boot_kill_action_taken + " no kill until"
|
109 |
total_msg += no_boot_kill_action_taken + " no boot until "
|
| 110 |
elif ( int(hh) == int(start_hour_gmt) and last_auto_start_time != this_hour_time ):
|
110 |
elif ( int(hh) == int(start_hour_gmt) and last_auto_start_time != this_hour_time ):
|
| 111 |
total_msg += processStart( conn, instance, state_code, this_hour_str )
|
111 |
total_msg += processStart( conn, instance, state_code, this_hour_str )
|
| - |
|
112 |
else:
|
| - |
|
113 |
total_msg += "No boot action"
|
| 112 |
|
114 |
|
| 113 |
if ( this_hour_time >= no_boot_until_time ):
|
115 |
if ( this_hour_time <= no_kill_until_time ):
|
| 114 |
total_msg += no_boot_kill_action_taken + " no boot until"
|
116 |
total_msg += no_boot_kill_action_taken + " no kill until "
|
| 115 |
elif( int(hh) == int(stop_hour_gmt) and last_auto_stop_time != this_hour_time ):
|
117 |
elif( int(hh) == int(stop_hour_gmt) and last_auto_stop_time != this_hour_time ):
|
| 116 |
total_msg += processStop( conn, instance, state_code, this_hour_str )
|
118 |
total_msg += processStop( conn, instance, state_code, this_hour_str )
|
| - |
|
119 |
else:
|
| - |
|
120 |
total_msg += " - No kill action"
|
| 117 |
|
121 |
|
| 118 |
if ( total_msg != "" ):
|
122 |
if ( total_msg != "" ):
|
| 119 |
action_taken = total_msg
|
123 |
action_taken = total_msg
|
| 120 |
|
124 |
|
| 121 |
except:
|
125 |
except:
|