Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

enabled to use CCT modules from cct dir next to the image descriptor #166

Merged
merged 2 commits into from
Jul 3, 2017

Conversation

rwngwn
Copy link
Contributor

@rwngwn rwngwn commented Jul 3, 2017

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 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).
@@ -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)
Copy link
Member

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.

Copy link
Contributor Author

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.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add path to it?

Copy link
Member

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 :)

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))
Copy link
Member

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.

Copy link
Member

@goldmann goldmann Jul 3, 2017

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.

@rwngwn rwngwn force-pushed the cct_local_modules branch from 0a8a819 to aff8761 Compare July 3, 2017 12:48
@goldmann goldmann merged commit 7332781 into jboss-dockerfiles:develop Jul 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants