Skip to content

Make the allinea easyblock search for the templates in the easyconfig paths#1025

Merged
boegel merged 5 commits intoeasybuilders:developfrom
akesandgren:allinea-templates+system.config-handling
Dec 8, 2016
Merged

Make the allinea easyblock search for the templates in the easyconfig paths#1025
boegel merged 5 commits intoeasybuilders:developfrom
akesandgren:allinea-templates+system.config-handling

Conversation

@akesandgren
Copy link
Copy Markdown
Contributor

Also add support for specifying a system.config to install.

This makes it possible to keep the templates in the sites easyconfig repos and also handles installing a system.config file if requested.

… paths.

Also add support for specifying a system.config to install.
Comment thread easybuild/easyblocks/a/allinea.py Outdated
else:
raise EasyBuildError('No system.config file named %s found', sysconfig)
try:
shutil.copy(path, sysconf_path)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@akesandgren please use copy_file (from filetools module) instead

Comment thread easybuild/easyblocks/a/allinea.py Outdated
except OSError, err:
raise EasyBuildError("Failed to copy %s to %s: %s", path, sysconf_path, err)
try:
os.chmod(sysconf_path, 0444)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@akesandgren please use adjust_permissions function for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok...


try:
shutil.copy2(templ, templ_path)
shutil.copy(path, templ_path)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@akesandgren why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you mean the change from copy2 to copy, the installed file should have the same permissions as the rest of the installation, not whatever the template file had before the copy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok, thanks for the clarification

@boegel boegel added this to the v3.1 milestone Nov 15, 2016
@akesandgren
Copy link
Copy Markdown
Contributor Author

Anything else?

Comment thread easybuild/easyblocks/a/allinea.py Outdated
raise EasyBuildError("Failed to copy template %s to %s: %s", templ, templ_path, err)

# copy system.config if requested
sysconf_path = os.path.join(self.installdir, 'system.config')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚨 tabs detected! 🚨

fixed in akesandgren#2

@boegel boegel modified the milestones: 3.0.2, 3.1.0 Dec 8, 2016
…dling

get rid of tabs, clarify use of shutil.copy + minor style fixes
@boegel
Copy link
Copy Markdown
Member

boegel commented Dec 8, 2016

tested with existing Allinea easyconfigs, thanks @akesandgren!

@boegel boegel merged commit 70d3cc1 into easybuilders:develop Dec 8, 2016
@akesandgren akesandgren deleted the allinea-templates+system.config-handling branch December 9, 2016 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants