removed call to dd to increase size, as resize2fs already implements it, simplified resized state
authorPaul Tonelli <paul.tonelli@logilab.fr>
Fri, 08 Mar 2013 10:14:44 +0100
changeset 43 9a688e89c82d
parent 42 e631de884792
child 44 951ab134da5e
removed call to dd to increase size, as resize2fs already implements it, simplified resized state
_states/tmp_func.py
--- a/_states/tmp_func.py	Fri Mar 08 10:13:48 2013 +0100
+++ b/_states/tmp_func.py	Fri Mar 08 10:14:44 2013 +0100
@@ -131,17 +131,10 @@
             ret['result'] = False
             ret['comment'] = 'Not enough free space'
             return ret
-        info = __salt__['cmd.run_all']('dd if=/dev/zero bs=1024k count='
-                + str(change_value / pow(1024, 2)) + ' >> ' + name)
-        if info['retcode']:
-            ret['result'] = False
-            ret['comment'] = 'Error while adding space to {0}: {1}'.format(name, info['stderr'])
-            return ret
-    else:
-        if minimum_size < abs(change_value): #decrease size to what asked
-            additionnal_flags = ' ' + str(new_size / block_size)
-        else: #minimise to min possible
-            minimize = '-M '
+    if minimum_size < abs(change_value): #cnange size to what asked
+        additionnal_flags = ' ' + str(new_size / block_size)
+    else: #minimise to min possible
+        minimize = '-M '
     info = __salt__['cmd.run_all']('resize2fs -f ' + minimize + name + additionnal_flags)
     if info['retcode']:
         ret['result'] = False