Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 859441 Details for
Bug 1061529
addCopySpecLimit function doesn't consider file sizes in recursive subdirectories
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Test script to reproduce and highlight the problem
sosSpecTest.py (text/x-python), 1.55 KB, created by
Dustin Black
on 2014-02-05 02:39:49 UTC
(
hide
)
Description:
Test script to reproduce and highlight the problem
Filename:
MIME Type:
Creator:
Dustin Black
Created:
2014-02-05 02:39:49 UTC
Size:
1.55 KB
patch
obsolete
>#!/usr/bin/python > >from sos.helpers import * >from sos import _sos as _ >import os, os.path, sys, string, glob, re, traceback >import shutil >from stat import * >from time import time >from itertools import * >from collections import deque > >from stat import ST_UID, ST_GID, ST_MODE, ST_CTIME, ST_ATIME, ST_MTIME, S_IMODE > >def addCopySpec(flog): > print flog > >def addCopySpecLimit(fname, sizelimit = None): > """Add a file specification (with limits) > """ > if not ( fname and len(fname) ): > soslog.warning("invalid file path") > return False > files = glob.glob(fname) > files.sort() > cursize = 0 > limit_reached = False > sizelimit *= 1024 * 1024 # in MB > for flog in files: > cursize += os.stat(flog)[ST_SIZE] > if sizelimit and cursize > sizelimit: > print "** Size %-10s %s" % (str(os.stat(flog)[ST_SIZE]/1024), flog) > limit_reached = True > else: > print " Size %-10s %s" % (str(os.stat(flog)[ST_SIZE]/1024), flog) > # Truncate the first file (others would likely be compressed), > # ensuring we get at least some logs > if flog == files[0] and limit_reached: > collectExtOutput("tail -c%d %s" % (sizelimit, flog), > "tail_" + os.path.basename(flog), flog[1:]) > >addCopySpecLimit("/var/log/glusterfs", sizelimit = 15) >addCopySpecLimit("/var/log/glusterfs/geo-replication/", sizelimit = 15) >addCopySpecLimit("/var/log/glusterfs/geo-replication-slaves/", sizelimit = 15) > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1061529
: 859441