Cleanup some prints in the resources
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
555bb45cd5
commit
b3893cde96
@ -73,8 +73,8 @@ class Resource(object):
|
|||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
for c in self.depends_on:
|
for c in self.depends_on:
|
||||||
#print '%s->%s.start()' % (self.name, self.stack.resources[c].name)
|
|
||||||
self.stack.resources[c].start()
|
self.stack.resources[c].start()
|
||||||
|
print 'starting %s name:%s' % (self.t['Type'], self.name)
|
||||||
|
|
||||||
self.stack.resolve_attributes(self.t)
|
self.stack.resolve_attributes(self.t)
|
||||||
self.stack.resolve_joins(self.t)
|
self.stack.resolve_joins(self.t)
|
||||||
@ -98,7 +98,7 @@ class Resource(object):
|
|||||||
self.state = new_state
|
self.state = new_state
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
print 'stopping %s id:%s' % (self.name, self.instance_id)
|
print 'stopping %s name:%s id:%s' % (self.t['Type'], self.name, self.instance_id)
|
||||||
|
|
||||||
def reload(self):
|
def reload(self):
|
||||||
pass
|
pass
|
||||||
@ -240,9 +240,9 @@ class VolumeAttachment(Resource):
|
|||||||
self.state_set(self.CREATE_IN_PROGRESS)
|
self.state_set(self.CREATE_IN_PROGRESS)
|
||||||
super(VolumeAttachment, self).start()
|
super(VolumeAttachment, self).start()
|
||||||
|
|
||||||
print 'InstanceId %s' % self.t['Properties']['InstanceId']
|
print 'Attaching InstanceId %s VolumeId %s Device %s' % (self.t['Properties']['InstanceId'],
|
||||||
print 'VolumeId %s' % self.t['Properties']['VolumeId']
|
self.t['Properties']['VolumeId'],
|
||||||
print 'Device %s' % self.t['Properties']['Device']
|
self.t['Properties']['Device'])
|
||||||
va = self.nova().volumes.create_server_volume(server_id=self.t['Properties']['InstanceId'],
|
va = self.nova().volumes.create_server_volume(server_id=self.t['Properties']['InstanceId'],
|
||||||
volume_id=self.t['Properties']['VolumeId'],
|
volume_id=self.t['Properties']['VolumeId'],
|
||||||
device=self.t['Properties']['Device'])
|
device=self.t['Properties']['Device'])
|
||||||
@ -263,14 +263,15 @@ class VolumeAttachment(Resource):
|
|||||||
self.state_set(self.DELETE_IN_PROGRESS)
|
self.state_set(self.DELETE_IN_PROGRESS)
|
||||||
Resource.stop(self)
|
Resource.stop(self)
|
||||||
|
|
||||||
print 'VolumeAttachment un-attaching %s %s' % (self.instance_id, self.t['Properties']['VolumeId'])
|
print 'VolumeAttachment un-attaching %s %s' % (self.t['Properties']['InstanceId'],
|
||||||
|
self.instance_id)
|
||||||
|
|
||||||
self.nova().volumes.delete_server_volume(self.t['Properties']['InstanceId'],
|
self.nova().volumes.delete_server_volume(self.t['Properties']['InstanceId'],
|
||||||
self.t['Properties']['VolumeId'])
|
self.t['Properties']['VolumeId'])
|
||||||
|
|
||||||
vol = self.nova('volume').volumes.get(self.t['Properties']['VolumeId'])
|
vol = self.nova('volume').volumes.get(self.t['Properties']['VolumeId'])
|
||||||
while vol.status == 'in-use':
|
while vol.status == 'in-use':
|
||||||
print 'trying to un-attach %s, but still in-use' % self.instance_id
|
print 'trying to un-attach %s, but still %s' % (self.instance_id, vol.status)
|
||||||
eventlet.sleep(1)
|
eventlet.sleep(1)
|
||||||
vol.get()
|
vol.get()
|
||||||
|
|
||||||
@ -345,11 +346,13 @@ class Instance(Resource):
|
|||||||
new_script.append(l)
|
new_script.append(l)
|
||||||
userdata = '\n'.join(new_script)
|
userdata = '\n'.join(new_script)
|
||||||
|
|
||||||
|
# TODO(asalkeld) this needs to go into the metadata server.
|
||||||
try:
|
try:
|
||||||
con = self.t['Metadata']["AWS::CloudFormation::Init"]['config']
|
con = self.t['Metadata']["AWS::CloudFormation::Init"]['config']
|
||||||
for st in con['services']:
|
for st in con['services']:
|
||||||
for s in con['services'][st]:
|
for s in con['services'][st]:
|
||||||
print 'service start %s_%s' % (self.name, s)
|
pass
|
||||||
|
#print 'service start %s_%s' % (self.name, s)
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
# if there is no config then no services.
|
# if there is no config then no services.
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user