-
Notifications
You must be signed in to change notification settings - Fork 14
enabled to use CCT modules from cct dir next to the image descriptor #166
Conversation
Dogen CCT plugin can now inject CCT modules from directory next to image descriptor as follows: if you have directory structure like: ``` image.yaml cct/module1 cct/module2 ``` Dogen CCT plugin will make module1 and modul2 available in target directory for CCT to use them. If cct/module1 is symbolink link its target directory gets copied (symlink is followed).
dogen/plugins/cct.py
Outdated
@@ -91,6 +91,14 @@ def prepare(self, cfg): | |||
|
|||
os.makedirs(target_modules_dir) | |||
|
|||
local_modules_dir = os.path.join(os.path.dirname(self.descriptor),'cct') | |||
self.log.debug('Found existing modules in directory: %s' % local_modules_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would give it more visibility by using info
log level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm logging real modules name if its get copied - this is IMHO ok as Debug its only telling some convention.
dogen/plugins/cct.py
Outdated
self.log.debug('Found existing modules in directory: %s' % local_modules_dir) | ||
if os.path.exists(local_modules_dir): | ||
for module in os.listdir(local_modules_dir): | ||
self.log.info('Using cached module %s.' % module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add path to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And remove the dot at the end :)
dogen/plugins/cct.py
Outdated
if os.path.exists(local_modules_dir): | ||
for module in os.listdir(local_modules_dir): | ||
module_path = os.path.join(local_modules_dir, module) | ||
self.log.info('Using cached module "%s" from path:"%s"' % (module, module_path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly, add a space before path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in general - we use single quote to quote things in strings. You did it other way.
Dogen CCT plugin can now inject CCT modules from directory next to
image descriptor as follows:
if you have directory structure like:
Dogen CCT plugin will make module1 and modul2 available in target
directory for CCT to use them.
If cct/module1 is symbolink link its target directory gets copied (symlink
is followed).