From 3046af38e90b3d7c3033dbf8afa5b45cd17b6ed7 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 25 Mar 2013 11:58:33 +0000 Subject: [PATCH] [molecule.specs] GenericSpec: store the .spec file path inside the class object --- molecule/settings.py | 2 +- molecule/specs/skel.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/molecule/settings.py b/molecule/settings.py index 9908556..da5d4fe 100644 --- a/molecule/settings.py +++ b/molecule/settings.py @@ -222,7 +222,7 @@ class SpecParser(object): " not supported, strategy: %s" % ( self.filepath, execution_strategy,)) - self.__plugin = plugin() + self.__plugin = plugin(filepath) self.vital_parameters = self.__plugin.vital_parameters() self.parameters = self.__plugin.parameters() diff --git a/molecule/specs/skel.py b/molecule/specs/skel.py index ecd57b7..327b551 100644 --- a/molecule/specs/skel.py +++ b/molecule/specs/skel.py @@ -80,6 +80,15 @@ class GenericSpec(object): # Molecule Plugin factory support BASE_PLUGIN_API_VERSION = 1 + def __init__(self, spec_file): + """ + Object constructor. + + @param spec_file: path to the spec file to be parsed + @type spec_file: string + """ + self._spec_file = spec_file + def _command_splitter(self, string): """ Split a command string into list using shlex.