def _security_grp_instance_attribute_handler(self):
    new_security_grp_list = []
    for (key, value) in self.querystring.items():
        if ('GroupId.' in key):
            new_security_grp_list.append(self.querystring.get(key)[0])
    instance_ids = instance_ids_from_querystring(self.querystring)
    instance_id = instance_ids[0]
    if self.is_not_dryrun('ModifyInstanceSecurityGroups'):
        self.ec2_backend.modify_instance_security_groups(instance_id, new_security_grp_list)
        return EC2_MODIFY_INSTANCE_ATTRIBUTE
def _security_grp_instance_attribute_handler(self):
    new_security_grp_list = []
    for (key, value) in self.querystring.items():
        if ('GroupId.' in key):
            new_security_grp_list.append(self.querystring.get(key)[0])
    instance_ids = instance_ids_from_querystring(self.querystring)
    instance_id = instance_ids[0]
    if self.is_not_dryrun('ModifyInstanceSecurityGroups'):
        self.ec2_backend.modify_instance_security_groups(instance_id, new_security_grp_list)
        return EC2_MODIFY_INSTANCE_ATTRIBUTE