Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copy for multi-account/regions case #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhirafovod
Copy link

distami was failing with the following error running with multiple accounts/regiond:

distami ami-12345678 --accounts=111111111111,222222222222 --non-public -v --to us-east-1,ap-northeast-1 -v -p

was failing with an error like a one below:

2016-10-11 00:33:40 [INFO] Sharing AMI ami-12345678 with AWS Accounts 111111111111,222222222222
Traceback (most recent call last):
  File "/usr/local/bin/distami", line 9, in <module>
    load_entry_point('distami==1.0.7', 'console_scripts', 'distami')()
  File "/usr/local/lib/python2.7/dist-packages/distami/cli.py", line 132, in run
    copy([distami, region, args])
  File "/usr/local/lib/python2.7/dist-packages/distami/cli.py", line 54, in copy
    distami.share_ami_with_accounts(args.accounts)
  File "/usr/local/lib/python2.7/dist-packages/distami/core.py", line 87, in share_ami_with_accounts
    res = self._image.set_launch_permissions(user_ids=account_ids)
  File "/usr/local/lib/python2.7/dist-packages/boto/ec2/image.py", line 353, in set_launch_permissions
    dry_run=dry_run)
  File "/usr/local/lib/python2.7/dist-packages/boto/ec2/connection.py", line 519, in modify_image_attribute
    return self.get_status('ModifyImageAttribute', params, verb='POST')
  File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1226, in get_status
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidAMIAttributeItemValue</Code><Message>Invalid attribute item value "111111111111,222222222222 " for userId item type.</Message></Error></Errors><RequestID><REDACTED></RequestID></Response>

Minor changes: Updated zones in unittests to reflect new zones introduced by AWS

Updated zones in unittests to reflect new zones introduced by AWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant