diff --git a/citools/fabfile.py b/citools/fabfile.py index 7e6985c..99dbead 100644 --- a/citools/fabfile.py +++ b/citools/fabfile.py @@ -179,7 +179,7 @@ def getlistpackageslocal(dpkgl_file): result[row[0]] = [row[0], row[1]] return result -def install_production_packages(clean_machine, production_machine): +def install_production_packages(clean_machine, production_machine, production_backend_machine=None): """ This function get dpkg -l from url from production and install it including versions Has two required arguments the clean machine for installing production packages and production machine for comparation packages @@ -210,6 +210,11 @@ def install_production_packages(clean_machine, production_machine): dpkgl_file = urllib.urlopen('http://cml.tunel.chservices.cz/cgi-bin/dpkg.pl?host=%s' % (production_machine,)) PACKAGES_LIST = getlistpackages(dpkgl_file) + if production_backend_machine: + dpkgl_file = urllib.urlopen('http://cml.tunel.chservices.cz/cgi-bin/dpkg.pl?host=%s' % (production_backend_machine,)) + backend_packages_list = getlistpackages(dpkgl_file) + backend_packages_list.update(PACKAGES_LIST) + PACKAGES_LIST = backend_packages_list client = paramiko.SSHClient() client.load_system_host_keys() diff --git a/citools/pavement.py b/citools/pavement.py index 1c38d2e..76a4cdc 100644 --- a/citools/pavement.py +++ b/citools/pavement.py @@ -242,11 +242,13 @@ def ping_buildmaster(): @task @cmdopts([ ('production-machine=', 'p', 'Production machine'), - ('clean-machine=', 'c', 'Clean machine') + ('clean-machine=', 'c', 'Clean machine'), + ('production-backend-machine=', 'b', 'Production backend machine') ]) def install_production_packages(options): production_machine = getattr(options, "production_machine") clean_machine = getattr(options, "clean_machine") + production_backend_machine = getattr(options, "production_backend_machine", None) fabfile_name = getattr(options, "fabfile_name", '') # import your fabfile if fabfile_name != '': @@ -254,7 +256,7 @@ def install_production_packages(options): else: fabfile = import_fabfile() # invoke fabric task - args = (clean_machine, production_machine) + args = (clean_machine, production_machine, production_backend_machine) options.packages_list = fab(clean_machine, fabfile['install_production_packages'], resolve,