only do an update of the container and not an upgrade
authorPaul Tonelli <paul.tonelli@logilab.fr>
Fri, 08 Mar 2013 11:29:47 +0100
changeset 47 4f52499c0eae
parent 46 c0fd55eb7989
child 48 c03c587f39d3
only do an update of the container and not an upgrade
_modules/vm_create.py
--- a/_modules/vm_create.py	Fri Mar 08 11:28:44 2013 +0100
+++ b/_modules/vm_create.py	Fri Mar 08 11:29:47 2013 +0100
@@ -34,7 +34,7 @@
     #files_to_delete = []
     #log.info(__salt__['file.remove'](chroot_dirname + "/etc/resolv.conf"))
     #log.info(salt.utils.copyfile('/etc/resolv.conf', chroot_dirname + '/etc/resolv.conf'))
-    _print_if_error(_chroot_exec(chroot_dirname, 'apt-get --force-yes -y update && apt-get upgrade'))
+    _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'))
     #return files_to_delete
 
@@ -55,26 +55,25 @@
     log.info(_chroot_exec(chroot_dirname, 'salt-call  --local state.highstate'))
 
 
-def create_variation(archive_name, variation_filename, path=DEFAULT_PATH,
-        upload_to_glance=None):
+def create_variation(path=DEFAULT_PATH, upload_to_glance=None):
     '''
     complete function to create the new variation from a virtual machine
 
     CLI Example::
 
-        salt '*' vm_create.create_variation raring_image.tar.gz vanilla
+        salt '*' vm_create.create_variation
     '''
     image_dirname = DEFAULT_MOUNT_DIR
     ### Exec pre state here ###
+    log.info(__salt__['state.sls']('ami_creator_pre'))
     update_image(path + '/' + image_dirname)
-    log.info(__salt__['state.sls']('ami_creator_pre'))
-    variate_image(path + '/' + image_dirname, variation_filename)
+    variate_image(path + '/' + image_dirname)
+    log.info(__salt__['state.sls']('ami_creator_post'))
     kernel_name = DEFAULT_KERNEL_NAME
     ramdisk_name = DEFAULT_RAMDISK_NAME
     kernel_name = "vmlinuz_" + DEFAULT_MOUNT_DIR
     ramdisk_name = "ramdisk_" + DEFAULT_MOUNT_DIR
     #resize_and_check(path, image_name)
-    log.info(__salt__['state.sls']('ami_creator_post'))
     if bool(upload_to_glance):
         log.info('will now upload to glance server')
         id_kernel = __salt__['openstack_client.upload_to_glance'](