def update_group(self, group_config, launch_config): """ Update the Auto-Scaling Group :type group_config: dict :param group_config: auto-scaling group configuration :type launch_config: dict :param launch_config: launch configuration """ group_name = group_config['AutoScalingGroupName'] try: group_data = clean_empty_items(self.fetch_group(group_name)) except Exception, e: log.error(e) return False
:type group_config: dict :param group_config: auto-scaling group configuration :type launch_config: dict :param launch_config: launch configuration """ group_name = group_config['AutoScalingGroupName'] try: group_data = clean_empty_items(self.fetch_group(group_name)) except Exception, e: log.error(e) return False lc_name = group_data['LaunchConfigurationName'] try: launch_data = clean_empty_items(self.fetch_launch_config(lc_name)) except Exception, e: log.error(e) return False # FIXME: trick to remove user-data user_data = launch_config.pop('UserData') launch_config = dict_merge(launch_data, launch_config) # FIXME: need to refine and remove the unused items launch_config['UserData'] = user_data if 'CreatedTime' in launch_config: launch_config.pop('CreatedTime') if 'LaunchConfigurationARN' in launch_config: launch_config.pop('LaunchConfigurationARN')