[NEW PATCH] Related to BZ#716692: avoid pyflakes error (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/645
commit dc821613120e7c42874ab607ac5536346739d826
Author: Dan Kenigsberg <danken(a)redhat.com>
Date: Sun Jul 3 11:12:42 2011 +0300
Related to BZ#716692: avoid pyflakes error
Change-Id: I0a3d179549aa744ac47749fbcac236ef2211cbe9
diff --git a/vdsm/netinfo.py b/vdsm/netinfo.py
index c26bc25..e1bbf90 100644
--- a/vdsm/netinfo.py
+++ b/vdsm/netinfo.py
@@ -147,7 +147,7 @@ def getRoutes():
gateways = dict()
with open("/proc/net/route") as route_file:
- head = route_file.readline()
+ route_file.readline() # skip header line
for route_line in route_file.xreadlines():
route_parm = route_line.rstrip().split('\t')
12 years, 10 months
[NEW PATCH] BZ#716692 Report the real gateway for the networks (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/631
commit 0c4496b13119f7480843e4a2daff90d614b1f26d
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Tue Jun 28 14:00:31 2011 +0000
BZ#716692 Report the real gateway for the networks
Change-Id: Ifcafa3617bcab3a720f229bfce45d49c9109b37d
diff --git a/vdsm/netinfo.py b/vdsm/netinfo.py
index d2d0795..c26bc25 100644
--- a/vdsm/netinfo.py
+++ b/vdsm/netinfo.py
@@ -131,6 +131,33 @@ def getVlanBondingNic(bridge):
nics = [iface]
return vlan, bonding, nics
+def intToAddress(ip_num):
+ "Convert an integer to the corresponding ip address in the dot-notation"
+ ip_address = []
+
+ for i in xrange(4):
+ ip_num, ip_val = divmod(ip_num, 256)
+ ip_address.append(str(ip_val))
+
+ return '.'.join(ip_address)
+
+def getRoutes():
+ """Return the interface gateway or None if not found."""
+
+ gateways = dict()
+
+ with open("/proc/net/route") as route_file:
+ head = route_file.readline()
+
+ for route_line in route_file.xreadlines():
+ route_parm = route_line.rstrip().split('\t')
+
+ if route_parm[2] != '00000000':
+ ip_num = int(route_parm[2], 16)
+ gateways[route_parm[0]] = intToAddress(ip_num)
+
+ return gateways
+
def getIfaceCfg(iface):
d = {}
try:
@@ -161,11 +188,13 @@ def permAddr():
def get():
d = {}
ifaces = ifconfig()
+ routes = getRoutes()
# FIXME handle bridge/nic missing from ifconfig
d['networks'] = dict([ (bridge, {'ports': ports(bridge),
'stp': bridge_stp_state(bridge),
'addr': ifaces[bridge]['addr'],
'netmask': ifaces[bridge]['netmask'],
+ 'gateway': routes.get(bridge, '0.0.0.0'),
'cfg': getIfaceCfg(bridge)})
for bridge in bridges() ])
d['nics'] = dict([ (nic, {'speed': speed(nic),
12 years, 10 months
[NEW PATCH] BZ#716962 logrotate: compress logs using the xz format (via gerrit-bot)
by Dan Kenigsberg
New patch submitted by Dan Kenigsberg (danken(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/632
commit f7d79ce0791e8cb8281b0d5974c2667ce2b38c49
Author: Federico Simoncelli <fsimonce(a)redhat.com>
Date: Tue Jun 28 14:12:04 2011 +0000
BZ#716962 logrotate: compress logs using the xz format
Change-Id: I736c5e625e4d4fba8d5d7d220ee86df9f01cd7fb
diff --git a/vdsm/vdsm-logrotate b/vdsm/vdsm-logrotate
index 4c84d7e..efa9e09 100755
--- a/vdsm/vdsm-logrotate
+++ b/vdsm/vdsm-logrotate
@@ -7,7 +7,6 @@ if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
-/usr/bin/find /var/log/core -type f -name '*gz' -mtime +7 -exec /bin/rm -f '{}' \;
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT clean old core files exited abnormally with [$EXITVALUE]"
diff --git a/vdsm/vdsm-logrotate.conf b/vdsm/vdsm-logrotate.conf
index 2962ce3..12e16ad 100644
--- a/vdsm/vdsm-logrotate.conf
+++ b/vdsm/vdsm-logrotate.conf
@@ -4,12 +4,21 @@
copytruncate
size 15M
compress
+ compresscmd /usr/bin/xz
+ uncompresscmd /usr/bin/unxz
+ compressext .xz
}
/var/log/core/*.dump {
rotate 1
missingok
size 0
compress
+ compresscmd /usr/bin/xz
+ uncompresscmd /usr/bin/unxz
+ compressext .xz
+}
+/var/log/core/*.dump.xz {
+ maxage 7
}
/var/log/libvirtd*.log {
rotate 100
@@ -17,4 +26,7 @@
copytruncate
size 15M
compress
+ compresscmd /usr/bin/xz
+ uncompresscmd /usr/bin/unxz
+ compressext .xz
}
12 years, 10 months