#809 Get back Atomic AMIs and include ap-south-1 and ap-northeast-2 regions
Merged 2 years ago by robyduck. Opened 2 years ago by sinnykumari.
sinnykumari/fedora-websites master  into  master

file modified
+2

@@ -324,6 +324,8 @@ 

      region(u'Asia Pacific NE (Tokyo)',         u'Tokyo',        u'ap-northeast-1'),

      region(u'Asia Pacific SE (Sydney)',        u'Sydney',       u'ap-southeast-2'),

      region(u'South America East (Sāo Paulo)',  u'Saopaolo',     u'sa-east-1'),

+     region(u'Asia Pacific (Seoul)',            u'Seoul',        u'ap-northeast-2'),

+     region(u'Asia Pacific (Mumbai)',           u'Mumbai',       u'ap-south-1')

  ]

  

  path_stats={

@@ -74,7 +74,6 @@ 

          intermediary = collections.OrderedDict()

          target = template.format(**release)

          log.info("Looking for AMIs for %s" % target)

- 

          messages = get_messages(target)

          for message in messages:

              key = message['msg']['image_name']

@@ -97,7 +96,7 @@ 

                  if matches(upload['extra']):

                      ami = upload['extra']['id']

                      # The region looks like "EC2 (REGION)", so we strip stuff.

-                     region = upload['destination'][5:-1]

+                     region = upload['destination']

                      results[name][region] = ami

  

      shelf['timestamp'] = datetime.utcnow()

file modified
+2 -2

@@ -62,7 +62,7 @@ 

  

  def filter_messages(messages, target):

      for message in messages:

-         if target in str(message):

+         if target in str(message) and 'completed' in str(message):

              yield message

  

  

@@ -116,7 +116,7 @@ 

  

  def mocked_fedimg(templates):

      regions = ['us-east-1', 'ap-northeast-1', 'sa-east-1', 'ap-southeast-1', 'ap-southeast-2',

-                'us-west-2', 'us-west-1', 'eu-central-1', 'eu-west-1']

+                'us-west-2', 'us-west-1', 'eu-central-1', 'eu-west-1', 'ap-northeast-2', 'ap-south-1']

      mockdata = {}

      for region in regions:

          mockdata[region] = 'ami-mocked'

With new fedimg-1.2.0 in use, json data from fedmsg
AMI upload is a bit different. Now, destination fields doesn't
contain EC2 in it. EC2 is defined in a separate field called service.

Include messages from topic fedimg.image.upload only if
status is completed. For status:started, now extra{} is non-empty and
this can causes website build to fail.

Signed-off-by: Sinny Kumari sinny@redhat.com

Pull-Request has been merged by robyduck

2 years ago