Comment 5 for bug 1319995

Revision history for this message
Dmitry Ilyin (idv1985) wrote :

--- pmanager-new.py 2014-05-19 19:13:44.630723562 +0000
+++ pmanager-old.py 2014-05-18 21:24:28.000000000 +0000
@@ -104,7 +104,7 @@

     def _gettabfsoptions(self, vol):
         if self._gettabfstype(vol) == "xfs":
- return "-f"
+ return "-f -s size=512"
         return ""

     def _getfstype(self, vol):
@@ -277,13 +277,14 @@
                               "--typecode={0}:{1} {2}".format(
                                   pcount, part["partition_guid"],
                                   self._disk_dev(disk)))
- if size > 0 and size <= 16777216 and part["mount"] != "none":
+ if size > 0 and size <= 16777216 and tabfstype != "xfs":
                     self.kick("partition {0} "
                               "--onpart={2}"
                               "{3}{4}".format(part["mount"], size,
                                            self._disk_dev(disk),
                                            self._pseparator(disk["id"]),
                                            pcount))
+
                 else:
                     if part["mount"] != "swap" and tabfstype != "none":
                         disk_label = self._getlabel(part.get('disk_label'))
@@ -410,7 +411,7 @@
                 tabfstype = self._gettabfstype(lv)
                 tabfsoptions = self._gettabfsoptions(lv)

- if size > 0 and size <= 16777216:
+ if size > 0 and size <= 16777216 and tabfstype != "xfs":
                     self.kick("logvol {0} --vgname={1} --size={2} "
                               "--name={3} {4}".format(
                                   lv["mount"], vg["id"], size,
@@ -587,7 +588,7 @@

     def _fsoptions(self, fstype):
         if fstype == "xfs":
- return "-f"
+ return "-f -s size=512"
         return ""

     def _umount_target(self):
@@ -616,18 +617,14 @@
         """This method puts script which splits
         long line and sends them to logger
         #!/bin/sh
-
- read string
         chunk=80
-
- iterations=`expr ${#string} / $chunk + 1`
- i=0
- while [ $i -le $(( iterations - 1)) ]; do
- start_sym=$(( $i * ${chunk} + 1 ))
- end_sym=$(( $(( $i + 1 )) * ${chunk}))
- echo $string | cut -c ${start_sym}-${end_sym} | logger
- i=$(( i + 1 ))
- done
+ while read string; do
+ iterations=`expr ${#string} / $chunk + 1`; i=0;
+ while [ $i -le $(( iterations - 1)) ]; do
+ start_sym=$(( $i * ${chunk} + 1 ))
+ end_sym=$(( $(( $i + 1 )) * ${chunk}))
+ echo $string | cut -c ${start_sym}-${end_sym} | logger
+ i=$(( i + 1 )); done; done;
         """
         return (
             """echo '#!/bin/sh' > /tmp/long_logger.sh;""",

This is diff between the working version of pmanager.py and the current one.