--- 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.
--- 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 _gettabfsoption s(self, vol): ype(vol) == "xfs":
if self._gettabfst
- return "-f"
+ return "-f -s size=512"
return ""
def _getfstype(self, vol):
"--typecode= {0}:{1} {2}".format(
pcount, part["partition _guid"] ,
self._disk_ dev(disk) ))
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' ))
tabfstype = self._gettabfst ype(lv)
tabfsoptions = self._gettabfso ptions( lv)
@@ -277,13 +277,14 @@
- if size > 0 and size <= 16777216 and part["mount"] != "none":
+ if size > 0 and size <= 16777216 and tabfstype != "xfs":
+
@@ -410,7 +411,7 @@
- if size > 0 and size <= 16777216:
self.kick( "logvol {0} --vgname={1} --size={2} "
"--name= {3} {4}".format(
lv["mount" ], vg["id"], size,
+ if size > 0 and size <= 16777216 and tabfstype != "xfs":
@@ -587,7 +588,7 @@
def _fsoptions(self, fstype):
if fstype == "xfs":
- return "-f"
+ return "-f -s size=512"
return ""
def _umount_ target( self): sym}-${ end_sym} | logger sym}-${ end_sym} | logger
" ""echo '#!/bin/sh' > /tmp/long_ logger. sh;""",
@@ -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_
- 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_
+ i=$(( i + 1 )); done; done;
"""
return (
This is diff between the working version of pmanager.py and the current one.