Exemplo n.º 1
0
def parse_data(data):
    for profile in data.get('AWSProfiles', []):
        AWSCredentialsManager.add_aws_profile(
            aws_profile=profile['AWS_PROFILE'],
            aws_access_key_id=profile['AWS_ACCESS_KEY_ID'],
            aws_secret_access_key=profile['AWS_SECRET_ACCESS_KEY'],
            aws_default_region=profile['AWS_DEFAULT_REGION'],
        )

    for alarm_group in data.get('AlarmGroups', []):
        AlarmsManager.add_alarm_group(**alarm_group)

    for tag_group in data.get('TagGroups', []):
        TagsManager.add_tag_group(**tag_group)

    for directory_path in data.get('Configuration').get('Plugins', []):
        ConfigurationManager.add_plugins_directory(directory_path)
Exemplo n.º 2
0
def parse_data(data):
    for profile in data.get('AWSProfiles', []):
        AWSCredentialsManager.add_aws_profile(
            aws_profile=profile['AWS_PROFILE'],
            aws_access_key_id=profile['AWS_ACCESS_KEY_ID'],
            aws_secret_access_key=profile['AWS_SECRET_ACCESS_KEY'],
            aws_default_region=profile['AWS_DEFAULT_REGION'],
        )

    for alarm_group in data.get('AlarmGroups', []):
        AlarmsManager.add_alarm_group(**alarm_group)

    for tag_group in data.get('TagGroups', []):
        TagsManager.add_tag_group(**tag_group)

    for directory_path in data.get('Configuration').get('Plugins', []):
        ConfigurationManager.add_plugins_directory(directory_path)
    def test_get_alarm_keys(self):
        AlarmsManager.add_alarm_group(**self.alarm_group)

        self.assertEqual(list(AlarmsManager.get_alarm_keys()),
                         ['fake-key:fake-value'])
    def test_get_alarm_group(self):
        AlarmsManager.add_alarm_group(**self.alarm_group)

        self.assertEqual(AlarmsManager.get_alarm_group('fake-key:fake-value'),
                         self.alarm_group)
Exemplo n.º 5
0
    def test_get_alarm_keys(self):
        AlarmsManager.add_alarm_group(**self.alarm_group)

        self.assertEqual(list(AlarmsManager.get_alarm_keys()),
                         ['fake-key:fake-value'])
Exemplo n.º 6
0
    def test_get_alarm_group(self):
        AlarmsManager.add_alarm_group(**self.alarm_group)

        self.assertEqual(AlarmsManager.get_alarm_group('fake-key:fake-value'),
                         self.alarm_group)