remove function variate_image
authorPaul Tonelli <paul.tonelli@logilab.fr>
Wed, 22 May 2013 17:00:16 +0200
changeset 138 32492b2ab2b4
parent 137 c655b19c9825
child 139 b7d52be2811a
remove function variate_image and replace by a chroot_exec call
_modules/vm_create.py
ami_creator.sls
--- a/_modules/vm_create.py	Mon May 27 10:22:12 2013 +0200
+++ b/_modules/vm_create.py	Wed May 22 17:00:16 2013 +0200
@@ -18,19 +18,6 @@
 
 log = logging.getLogger(__name__)
 
-def variate_image(path, variation_filename=DEFAULT_VARIATION_NAME):
-    '''
-    do all code relevant to personalizing the machine here
-    salt-minion should be available
-
-    CLI Example::
-
-        salt '*' vm_create.variate_image /mnt/variation
-
-    '''
-    return _print_if_error(_chroot_exec(path, 'salt-call  --local state.highstate'),
-                    info=True)
-
 def upload_to_glance(path):
     log.info('will now try to upload to glance server')
     ami_name = __salt__['grains.get']('ami.name')
--- a/ami_creator.sls	Mon May 27 10:22:12 2013 +0200
+++ b/ami_creator.sls	Wed May 22 17:00:16 2013 +0200
@@ -5,10 +5,11 @@
         - name: state.sls
         - mods: ami_pre
 
-variate_variant:
+chroot_variate:
     module.run:
-        - name: vm_create.variate_image
+        - name: vm_create.chroot_exec
         - path: /mnt/variation
+        - command: salt-call  --local state.highstate
         - require:
             - module.run: preparation
 
@@ -17,5 +18,5 @@
         - name: state.sls
         - mods: ami_post
         - require:
-            - module.run: variate_variant 
+            - module.run: chroot_variate