We may just want a installer object but not call the install() method just yet. So, move the source-code-pulling code to a separate method, that is called by install().
Signed-off-by: Eduardo Habkost <[email protected]> --- client/tests/kvm/kvm/installer.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/tests/kvm/kvm/installer.py b/client/tests/kvm/kvm/installer.py index e6a12ab..ba0e398 100644 --- a/client/tests/kvm/kvm/installer.py +++ b/client/tests/kvm/kvm/installer.py @@ -167,6 +167,8 @@ def save_build(build_dir, dest_dir): class BaseInstaller(object): def __init__(self, mode, test, params): + self.params = params + load_modules = params.get('load_modules', 'no') if not load_modules or load_modules == 'yes': self.should_load_modules = True @@ -456,13 +458,14 @@ class SourceDirInstaller(BaseInstaller): class GitInstaller(SourceDirInstaller): def __init__(self, mode, test, params): - """ - Initialize class parameters and retrieves code from git repositories. + super(GitInstaller, self).__init__(mode, test, params) - @param test: kvm test object. - @param params: Dictionary with test parameters. + + def _pull_code(self): """ - super(GitInstaller, self).__init__(mode, test, params) + Retrieves code from git repositories. + """ + params = self.params kernel_repo = params.get("git_repo") user_repo = params.get("user_git_repo") @@ -617,6 +620,7 @@ class GitInstaller(SourceDirInstaller): def install(self): + self._pull_code() self._build() self._install() if self.should_load_modules: -- 1.7.3.2 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
