changed parameter name from chroot_dir to path in module for easier call in sls files
authorPaul Tonelli <paul.tonelli@logilab.fr>
Mon, 25 Mar 2013 11:32:52 +0100
changeset 94 4a2b15de9ec9
parent 93 c5be902f46b7
child 95 3802b216e62d
changed parameter name from chroot_dir to path in module for easier call in sls files
_modules/vm_create.py
--- a/_modules/vm_create.py	Fri Mar 22 14:14:30 2013 +0100
+++ b/_modules/vm_create.py	Mon Mar 25 11:32:52 2013 +0100
@@ -18,7 +18,7 @@
 
 log = logging.getLogger(__name__)
 
-def update_image(chroot_dirname):
+def update_image(path):
     '''
     update image using apt-get. Doing so, it creates a few files.
     In order to be executed in chroot, you should use is with
@@ -28,11 +28,11 @@
 
         salt '*' vm_create.update_image /mnt/variation
     '''
-    _print_if_error(_chroot_exec(chroot_dirname, 'apt-get update'))
-    _print_if_error(_chroot_exec(chroot_dirname, 'apt-get --force-yes -y install salt-minion'))
+    _print_if_error(_chroot_exec(path, 'apt-get update'))
+    _print_if_error(_chroot_exec(path, 'apt-get --force-yes -y install salt-minion'))
     return True
 
-def variate_image(chroot_dirname, variation_filename=DEFAULT_VARIATION_NAME):
+def variate_image(path, variation_filename=DEFAULT_VARIATION_NAME):
     '''
     do all code relevant to personalizing the machine here
     salt-minion should be available
@@ -42,7 +42,7 @@
         salt '*' vm_create.variate_image /mnt/variation
 
     '''
-    log.info(_chroot_exec(chroot_dirname, 'salt-call  --local state.highstate'))
+    log.info(_chroot_exec(path, 'salt-call  --local state.highstate'))
     return True
 
 def create_variation(path=DEFAULT_PATH):