Permalink
Browse files

Make log messages for Mock plugins less fun but easier to understand

  • Loading branch information...
1 parent b074234 commit d8dc61f93c4b6c78959a8f25130a52e0789e7046 @imcleod imcleod committed Apr 21, 2012
Showing with 11 additions and 11 deletions.
  1. +4 −4 imgfac/plugins/MockRPMBasedOS/MockRPMBasedOS.py
  2. +7 −7 imgfac/plugins/MockSphere/MockSphere.py
@@ -27,9 +27,9 @@ def __init__(self):
self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))
def create_base_image(self, builder, template, parameters):
- self.log.info('Im N ur MockRPMBasedOS plugin... Im creatn Ur base image.')
- return BaseImage(template)
+ self.log.info('create_base_image() called in MockRPMBasedOS')
+ #return BaseImage(template)
def create_target_image(self, builder, target, base_image, parameters):
- self.log.info('Im N ur MockRPMBasedOS plugin... Im creatn Ur target image.')
- return TargetImage(base_image, target, parameters)
+ self.log.info('create_target_image() called in MockRPMBasedOS')
+ #return TargetImage(base_image, target, parameters)
@@ -16,6 +16,7 @@
import logging
import zope
+import inspect
from imgfac.CloudDelegate import CloudDelegate
from imgfac.ProviderImage import ProviderImage
@@ -27,18 +28,17 @@ def __init__(self):
self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))
def push_image_to_provider(self, builder, provider, credentials, target_image, parameters):
- self.log.info('Im N ur MockSphere plugin... Im pushn Ur image providings.')
- return ProviderImage(target_image, provider, credentials, parameters)
+ self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
def snapshot_image_on_provider(self, builder, provider, credentials, template, parameters):
- self.log.info('Im N ur MockSphere plugin... Im snapshottin Ur image providings.')
- return ProviderImage(None, provider, credentials, parameters)
+ self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
def builder_should_create_target_image(self, builder, target, image_id, template, parameters):
- self.log.info('Im N ur MockSphere plugin... Im dictatin Ur target image creatn.')
+ self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
+ return True
def builder_will_create_target_image(self, builder, target, image_id, template, parameters):
- self.log.info('Im N ur MockSphere plugin... I seen Ur creatn a target image.')
+ self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))
def builder_did_create_target_image(self, builder, target, image_id, template, parameters):
- self.log.info('Im N ur MockSphere plugin... I seen U create the target image.')
+ self.log.info('%s called in MockSphere plugin' % (inspect.stack()[1][3]))

0 comments on commit d8dc61f

Please sign in to comment.