Hi Fokke.

On 27/03/15 11:36, Fokko Masselink wrote:
This question is two-fold:
1. Is there any way to get the list of patches (full filenames with templates
substituted) from the EasyConfig file?
Probably start python and load several components... though I don't know how
(yet).
2. Is there any way to get the name and path of the EasyBlock from the
EasyConfig file?
Probably a similar answer to the first question.

The thought behind this is that I'm trying to set up a DTAP (dev, test,
accept, production) street.
And I want to propagate the easyconfig file including the patches and
easyblock to the next stage.

For now, we don't have a very user-friendly way of doing this.
Of course, you can query EasyBuild itself via a Python shell, but you need to be familiar with the framework a little bit...

In particular, you need to know where to find things, and how to configure EasyBuild without using the cmdline interface.

The code below should do what you're looking for:


from test.framework.utilities import init_config
cfg = init_config()

from easybuild.framework.easyconfig.easyconfig import EasyConfig, get_easyblock_class #ec = EasyConfig('/Users/kehoste/work/easybuild-easyconfigs/easybuild/easyconfigs/w/WRF/WRF-3.6.1-intel-2015a-dmpar.eb', validate=False) ec = EasyConfig('/Users/kehoste/work/easybuild-easyconfigs/easybuild/easyconfigs/z/zlib/zlib-1.2.5-ictce-4.1.13.eb', validate=False)

print "list of patches: %s" % ec['patches']

print "software name: %s" % ec['name']
print "specified easyblock: %s" % ec['easyblock']
print "derived easyblock: %s" % get_easyblock_class(ec['easyblock'], ec['name'])



regards,

Kenneth

Reply via email to