From 73b09f0c3b4358d69bff58c429ccb36cbdf26a36 Mon Sep 17 00:00:00 2001 From: Allan Hodkinson Date: Thu, 19 Oct 2017 15:19:53 +0100 Subject: [PATCH 1/2] Bug fix: Encode basic authentication credentials for _hurl_attack() as required for hurl -H option. --- beeswithmachineguns/bees.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beeswithmachineguns/bees.py b/beeswithmachineguns/bees.py index c290e9f..94738eb 100644 --- a/beeswithmachineguns/bees.py +++ b/beeswithmachineguns/bees.py @@ -998,7 +998,8 @@ def _hurl_attack(params): options += ' -H \"Cookie: %s;\"' % params['cookies'] if params['basic_auth'] is not '': - options += ' -H \"Authorization : Basic %s\"' % params['basic_auth'] + auth = base64.encodestring(params['basic_auth']).replace('\n', '') + options += ' -H \"Authorization : Basic %s\"' % auth if params['seconds']: options += ' -l %d' % params['seconds'] From 2b2c0fb786523d0bbf57c729638cc63c2a80cbbc Mon Sep 17 00:00:00 2001 From: Allan Hodkinson Date: Thu, 19 Oct 2017 15:37:05 +0100 Subject: [PATCH 2/2] Alter up() behaviour to start instances in specified subnet with specified security group rather than default. --- beeswithmachineguns/bees.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beeswithmachineguns/bees.py b/beeswithmachineguns/bees.py index 94738eb..05bf82c 100644 --- a/beeswithmachineguns/bees.py +++ b/beeswithmachineguns/bees.py @@ -207,7 +207,7 @@ def up(count, group, zone, image_id, instance_type, username, key_name, subnet, min_count=count, max_count=count, key_name=key_name, - security_group_ids=[groupId] if not subnet else None, + security_group_ids=[groupId], instance_type=instance_type, placement=placement, subnet_id=subnet)