Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2014-06-23 09:23:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crmsh" Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2014-06-16 21:25:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2014-06-23 09:24:01.000000000 +0200 @@ -1,0 +2,13 @@ +Thu Jun 19 16:39:16 UTC 2014 - [email protected] + +- Medium: hb_report: update interface to zypper (bnc#883186) +- Medium: hb_report: support logs with varied timestamps (bnc#883186) +- Low: hb_report: getstampproc is global (bnc#883186) +- Low: hb_report: gdb debug symbols output change (bnc#883186) +- Low: hb_report: don't restrict debuginfo to cluster stack binaries (zypper) (bnc#883186) +- high: ui_history: Lazily fetch report data on command (bnc#882959) +- medium: report: Make setting report period more robust (bnc#882959) +- medium: ui_history: Print source if given no argument (bnc#883437) +- upstream: 2.0.0-147-g9ea5208a0054 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.AzkmN3/_old 2014-06-23 09:24:02.000000000 +0200 +++ /var/tmp/diff_new_pack.AzkmN3/_new 2014-06-23 09:24:02.000000000 +0200 @@ -41,7 +41,7 @@ Summary: High Availability cluster command-line interface License: GPL-2.0+ Group: %{pkg_group} -Version: 2.0+git133 +Version: 2.0+git147 Release: %{?crmsh_release}%{?dist} Url: http://crmsh.github.io Source0: crmsh.tar.bz2 ++++++ crmsh.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/doc/crm.conf new/crmsh/doc/crm.conf --- old/crmsh/doc/crm.conf 2014-06-13 16:26:53.000000000 +0200 +++ new/crmsh/doc/crm.conf 2014-06-19 19:55:09.000000000 +0200 @@ -45,7 +45,7 @@ </div> </div> -<a href="https://github.com/crmsh/crmsh"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a> +<a href="https://github.com/crmsh/crmsh"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a> </body> </html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/hb_report/hb_report.in new/crmsh/hb_report/hb_report.in --- old/crmsh/hb_report/hb_report.in 2014-06-13 16:26:53.000000000 +0200 +++ new/crmsh/hb_report/hb_report.in 2014-06-19 19:55:09.000000000 +0200 @@ -1056,7 +1056,7 @@ } # get the right part of the log getlog() { - local getstampproc cnt + local cnt local outf outf=$WORKDIR/$HALOG_F @@ -1106,7 +1106,7 @@ # get all other info (config, stats, etc) # collect_info() { - local getstampproc l + local l sys_info > $WORKDIR/$SYSINFO_F 2>&1 & sys_stats > $WORKDIR/$SYSSTATS_F 2>&1 & getconfig $WORKDIR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/hb_report/utillib.sh new/crmsh/hb_report/utillib.sh --- old/crmsh/hb_report/utillib.sh 2014-06-13 16:26:53.000000000 +0200 +++ new/crmsh/hb_report/utillib.sh 2014-06-19 19:55:09.000000000 +0200 @@ -175,10 +175,21 @@ getstamp_rfc5424() { awk '{print $1}' } +get_ts() { + local l="$1" ts + ts=$(str2time `echo "$l" | $getstampproc`) + if [ -z "$ts" ]; then + local fmt + for fmt in rfc5424 syslog legacy; do + [ "getstamp_$fmt" = "$getstampproc" ] && continue + ts=$(str2time `echo "$l" | getstamp_$fmt`) + [ -n "$ts" ] && break + done + fi + echo $ts +} linetime() { - local l - l=`tail -n +$2 $1 | head -1 | $getstampproc` - str2time "$l" + get_ts "`tail -n +$2 $1 | head -1`" } find_getstampproc() { local t l func trycnt @@ -210,7 +221,7 @@ find_first_ts() { local l ts while read l; do - ts=$(str2time "`echo $l | $getstampproc`") + ts=`get_ts "$l"` [ "$ts" ] && break warning "cannot extract time: |$l|; will try the next one" done @@ -355,24 +366,30 @@ # regex pkg_mgr # no spaces allowed in regex cat<<EOF -Try:.zypper.install zypper +zypper.install zypper EOF } -MYBINARIES="crmd|pengine|lrmd|attrd|cib|mgmtd|stonithd|corosync|libplumb|libpils" listpkg_zypper() { local bins local binary=$1 core=$2 gdb $binary $core </dev/null 2>&1 | - awk -v bins="$MYBINARIES" ' + awk ' + # this zypper version dumps all packages on a single line + /Missing separate debuginfos.*zypper.install/ { + sub(".*zypper.install ",""); print + exit} n>0 && /^Try: zypper install/ {gsub("\"",""); print $NF} n>0 {n=0} - /Missing separate debuginfo/ && match($NF, bins) {n=1} + /Missing separate debuginfo/ {n=1} ' | sort -u } fetchpkg_zypper() { + local pkg debug "get debuginfo packages using zypper: $@" zypper -qn ref > /dev/null - zypper -qn install -C $@ >/dev/null + for pkg in $@; do + zypper -qn install -C $pkg >/dev/null + done } find_pkgmgr() { local binary=$1 core=$2 @@ -390,7 +407,7 @@ local binary=$1 core=$2 local pkg_mgr pkgs gdb $binary $core </dev/null 2>/dev/null | - grep 'no debugging symbols found' > /dev/null || + egrep 'Missing.*debuginfo|no debugging symbols found' > /dev/null || return # no missing debuginfo pkg_mgr=`find_pkgmgr $binary $core` if [ -z "$pkg_mgr" ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/report.py new/crmsh/modules/report.py --- old/crmsh/modules/report.py 2014-06-13 16:26:53.000000000 +0200 +++ new/crmsh/modules/report.py 2014-06-19 19:55:09.000000000 +0200 @@ -981,11 +981,16 @@ Set from/to_dt. ''' common_debug("setting report times: <%s> - <%s>" % (from_dt, to_dt)) - need_refresh = (self.source == "live") and self.ready and \ - (from_dt and self.get_rpt_dt(None, "top") > from_dt) self.from_dt = from_dt self.to_dt = to_dt - if need_refresh: + + refresh = False + if self.source == "live" and self.ready: + top_dt = self.get_rpt_dt(None, "top") + if top_dt is None: + return False + refresh = from_dt and top_dt > from_dt + if refresh: self.set_change_origin(CH_UPD) self.refresh_source(force=True) else: @@ -1307,9 +1312,12 @@ myts = min([syslog_ts(x) for x in first_log_lines(self.log_l)]) elif whence == "bottom": myts = max([syslog_ts(x) for x in last_log_lines(self.log_l)]) - return datetime.datetime.fromtimestamp(myts) - except: - return None + if myts: + return datetime.datetime.fromtimestamp(myts) + common_debug("No log lines with timestamps found in report") + except Exception, e: + common_debug("Error: %s" % (e)) + return None def _str_dt(self, dt): return dt and human_date(dt) or "--/--/-- --:--:--" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/ui_history.py new/crmsh/modules/ui_history.py --- old/crmsh/modules/ui_history.py 2014-06-13 16:26:53.000000000 +0200 +++ new/crmsh/modules/ui_history.py 2014-06-19 19:55:09.000000000 +0200 @@ -50,11 +50,14 @@ def __init__(self): command.UI.__init__(self) - self._set_source(options.history) self.current_session = None + self._source_inited = False - def _no_source(self): - common_err("we have no source set yet! please use the source command") + def _init_source(self): + if self._source_inited: + return True + self._source_inited = True + return self._set_source(options.history) def _set_period(self, from_time='', to_time=''): ''' @@ -103,6 +106,10 @@ @command.skill_level('administrator') def do_source(self, context, src=None): "usage: source {<dir>|<file>|live}" + if src is None: + print "Current source: %s" % (options.history) + return True + self._init_source() if src != options.history: return self._set_source(src) @@ -110,6 +117,7 @@ @command.alias('timeframe') def do_limit(self, context, from_time='', to_time=''): "usage: limit [<from_time> [<to_time>]]" + self._init_source() if options.history == "live" and not from_time: from_time = time.ctime(time.time() - 60*60) return self._set_period(from_time, to_time) @@ -117,6 +125,7 @@ @command.skill_level('administrator') def do_refresh(self, context, force=''): "usage: refresh" + self._init_source() if options.history != "live": common_info("nothing to refresh if source isn't live") return False @@ -129,6 +138,7 @@ @command.skill_level('administrator') def do_detail(self, context, detail_lvl): "usage: detail <detail_level>" + self._init_source() detail_num = utils.convert2ints(detail_lvl) if not (isinstance(detail_num, int) and int(detail_num) >= 0): bad_usage(context.get_command_name(), detail_lvl) @@ -139,6 +149,7 @@ @command.completers_repeating(compl.call(crm_report.node_list)) def do_setnodes(self, context, *args): "usage: setnodes <node> [<node> ...]" + self._init_source() if options.history != "live": common_info("setting nodes not necessary for existing reports, proceeding anyway") return crm_report.set_nodes(*args) @@ -146,11 +157,13 @@ @command.skill_level('administrator') def do_info(self, context): "usage: info" + self._init_source() return crm_report.info() @command.skill_level('administrator') def do_latest(self, context): "usage: latest" + self._init_source() if not utils.wait4dc("transition", not options.batch): return False self._set_source("live") @@ -164,6 +177,7 @@ @command.completers_repeating(compl.call(crm_report.rsc_list)) def do_resource(self, context, *args): "usage: resource <rsc> [<rsc> ...]" + self._init_source() return crm_report.resource(*args) @command.skill_level('administrator') @@ -171,12 +185,14 @@ @command.completers_repeating(compl.call(crm_report.node_list)) def do_node(self, context, *args): "usage: node <node> [<node> ...]" + self._init_source() return crm_report.node(*args) @command.skill_level('administrator') @command.completers_repeating(compl.call(crm_report.node_list)) def do_log(self, context, *args): "usage: log [<node> ...]" + self._init_source() return crm_report.log(*args) def ptest(self, nograph, scores, utilization, actions, verbosity): @@ -195,6 +211,7 @@ compl.choice(['v']))) def do_peinputs(self, context, *args): """usage: peinputs [{<range>|<number>} ...] [v]""" + self._init_source() argl = list(args) opt_l = utils.fetch_opts(argl, ["v"]) if argl: @@ -289,6 +306,7 @@ transition showdot [<number>|<index>|<file>] transition log [<number>|<index>|<file>] transition save [<number>|<index>|<file> [name]]""" + self._init_source() argl = list(args) subcmd = "show" if argl and argl[0] in ("showdot", "log", "save"): @@ -488,6 +506,7 @@ NB: The configuration is color rendered, but note that that depends on the current value of the TERM variable. ''' + self._init_source() opt_l = [] if not self._common_pe_render_check(context, opt_l, *args): return False @@ -506,6 +525,7 @@ compl.choice(['status'])) def do_show(self, context, t, *args): "usage: show <pe> [status]" + self._init_source() opt_l = [] if not self._common_pe_render_check(context, opt_l, *args): return False @@ -523,6 +543,7 @@ @command.completers(compl.join(compl.call(crm_report.peinputs_list), compl.choice(['live']))) def do_graph(self, context, t, *args): "usage: graph <pe> [<gtype> [<file> [<img_format>]]]" + self._init_source() pe_f = self._get_diff_pe_input(t) if not pe_f: return False @@ -548,6 +569,7 @@ compl.join(compl.call(crm_report.peinputs_list), compl.choice(['live']))) def do_diff(self, context, t1, t2, *args): "usage: diff <pe> <pe> [status] [html]" + self._init_source() opt_l = [] if not self._common_pe_render_check(context, opt_l, *args): return False @@ -572,6 +594,7 @@ compl.join(compl.call(crm_report.peinputs_list), compl.choice(['live']))) def do_wdiff(self, context, t1, t2, *args): "usage: wdiff <pe> <pe> [status]" + self._init_source() opt_l = [] if not self._common_pe_render_check(context, opt_l, *args): return False @@ -590,6 +613,7 @@ compl.call(crm_report.session_list)) def do_session(self, context, subcmd=None, name=None): "usage: session [{save|load|delete} <name> | pack [<name>] | update | list]" + self._init_source() if not subcmd: print "current session: %s" % self.current_session return True @@ -629,6 +653,7 @@ @command.completers(compl.choice(['clear'])) def do_exclude(self, context, arg=None): "usage: exclude [<regex>|clear]" + self._init_source() if not arg: rc = crm_report.manage_excludes("show") elif arg == "clear": -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
