Move kernel mapping out of run()

This commit is contained in:
Anders Ingemann 2013-07-13 13:18:01 +02:00
parent 64045a2808
commit 554d99fc7f

View file

@ -40,9 +40,6 @@ class RegisterAMI(Task):
phase = phases.image_registration
after = [CreateSnapshot]
def run(self, info):
arch = {'i386': 'i386',
'amd64': 'x86_64'}.get(info.manifest.system['architecture'])
kernel_mapping = {'us-east-1': {'amd64': 'aki-88aa75e1',
'i386': 'aki-b6aa75df'},
'us-west-1': {'amd64': 'aki-f77e26b2',
@ -61,7 +58,10 @@ class RegisterAMI(Task):
'i386': 'aki-ca8f51d7'},
'us-gov-west-1': {'amd64': 'aki-79a4c05a',
'i386': 'aki-7ba4c058'}}
kernel_id = kernel_mapping.get(info.host['region']).get(info.manifest.system['architecture'])
def run(self, info):
arch = {'i386': 'i386', 'amd64': 'x86_64'}.get(info.manifest.system['architecture'])
kernel_id = self.kernel_mapping.get(info.host['region']).get(info.manifest.system['architecture'])
from boto.ec2.blockdevicemapping import BlockDeviceType
from boto.ec2.blockdevicemapping import BlockDeviceMapping