Hello community,

here is the log from the commit of package crmsh for openSUSE:Factory checked 
in at 2015-10-28 17:31:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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      2015-10-22 
12:59:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2015-10-28 
17:31:17.000000000 +0100
@@ -1,0 +2,13 @@
+Wed Oct 28 08:51:59 UTC 2015 - kgronl...@suse.com
+
+- Update to version 2.2.0~rc3+git.1446022288.cbb7d77:
+  + medium: scripts: No optional steps in legacy wizards (bsc#952226)
+  + medium: ui_script: Tag legacy wizards as legacy in show (bsc#952226)
+
+-------------------------------------------------------------------
+Mon Oct 26 12:41:17 UTC 2015 - kgronl...@suse.com
+
+- Update to version 2.2.0~rc3+git.1445863187.686e3ec:
+  + high: utils: Revised time zone handling (bsc#951759)
+
+-------------------------------------------------------------------

Old:
----
  crmsh-2.2.0~rc3+git.1445338389.7433378.tar.bz2

New:
----
  crmsh-2.2.0~rc3+git.1446022288.cbb7d77.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ crmsh.spec ++++++
--- /var/tmp/diff_new_pack.j686HU/_old  2015-10-28 17:31:18.000000000 +0100
+++ /var/tmp/diff_new_pack.j686HU/_new  2015-10-28 17:31:18.000000000 +0100
@@ -36,7 +36,7 @@
 Summary:        High Availability cluster command-line interface
 License:        GPL-2.0+
 Group:          %{pkg_group}
-Version:        2.2.0~rc3+git.1445338389.7433378
+Version:        2.2.0~rc3+git.1446022288.cbb7d77
 Release:        0
 Url:            http://crmsh.github.io
 Source0:        %{name}-%{version}.tar.bz2

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.j686HU/_old  2015-10-28 17:31:18.000000000 +0100
+++ /var/tmp/diff_new_pack.j686HU/_new  2015-10-28 17:31:18.000000000 +0100
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
             <param name="url">git://github.com/ClusterLabs/crmsh.git</param>
-          <param 
name="changesrevision">7433378e1abf96bf84b4af781cec9ab16f6ed5f5</param></service></servicedata>
\ No newline at end of file
+          <param 
name="changesrevision">cbb7d776f5489f5925d3e243f1d2844c743fe889</param></service></servicedata>
\ No newline at end of file

++++++ crmsh-2.2.0~rc3+git.1445338389.7433378.tar.bz2 -> 
crmsh-2.2.0~rc3+git.1446022288.cbb7d77.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/constants.py 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/constants.py
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/constants.py     
2015-10-20 13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/constants.py     
2015-10-28 09:51:59.000000000 +0100
@@ -264,13 +264,14 @@
     "primitive": {
         "fillcolor": "#e4e5e6",
         "color": "#b9b9b9",
-        "style": "filled",
+        "shape": "box",
+        "style": "rounded,filled",
     },
     "rsc_template": {
-        "fillcolor": "#e4e5e6",
+        "fillcolor": "#ffd457",
         "color": "#b9b9b9",
-        "style": "filled",
-        "shape": "invhouse",
+        "shape": "box",
+        "style": "rounded,filled,dashed",
     },
     "class:stonith": {
         "shape": "box",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/report.py 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/report.py
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/report.py        
2015-10-20 13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/report.py        
2015-10-28 09:51:59.000000000 +0100
@@ -72,28 +72,30 @@
     return t
 
 
+_syslog2node_formats = (re.compile(r'^[a-zA-Z]{2,4} \d{1,2} 
\d{2}:\d{2}:\d{2}\s+(?:\[\d+\])?\s*([\S]+)'),
+                        
re.compile(r'^\d{4}-\d{2}-\d{2}T\S+\s+(?:\[\d+\])?\s*([\S]+)'))
+
+
 def syslog_ts(s):
     """
     Finds the timestamp in the given line
     Returns as floating point, seconds
     """
-    try:
-        # strptime defaults year to 1900 (sigh)
-        # strptime returns a time_struct
-        tm = time.strptime(' '.join([YEAR] + s.split()[0:3]),
-                           "%Y %b %d %H:%M:%S")
-        ts = time.mktime(tm)
-    except:  # try the rfc5424
-        try:
-            ts = datetime_to_timestamp(parse_time(s.split()[0]))
-        except Exception:
-            common_debug("malformed line: %s" % s)
-            return None
-    return ts
+    fmt1, fmt2 = _syslog2node_formats
+    m = fmt1.match(s)
+    if m:
+        if YEAR is None:
+            set_year()
+        tstr = ' '.join([YEAR] + s.split()[0:3])
+        return datetime_to_timestamp(parse_time(tstr))
 
+    m = fmt2.match(s)
+    if m:
+        tstr = s.split()[0]
+        return datetime_to_timestamp(parse_time(tstr))
 
-_syslog2node_formats = (re.compile(r'\w+ \d+ \d+:\d+:\d+ (?:\[\d+\])? (\w+)'),
-                        re.compile(r'\w+ (?:\[\d+\])? (\w+)'))
+    common_debug("malformed line: %s" % s)
+    return None
 
 
 def syslog2node(s):
@@ -428,8 +430,10 @@
     'Some human date representation. Date defaults to now.'
     if not dt:
         dt = make_datetime_naive(datetime.datetime.now())
+    # here, dt is in UTC. Convert to localtime:
+    localdt = datetime.datetime.fromtimestamp(datetime_to_timestamp(dt))
     # drop microseconds
-    return re.sub("[.].*", "", "%s %s" % (dt.date(), dt.time()))
+    return re.sub("[.].*", "", "%s %s" % (localdt.date(), localdt.time()))
 
 
 def is_log(p):
@@ -1388,7 +1392,8 @@
             elif whence == "bottom":
                 myts = max([syslog_ts(x) for x in last_log_lines(self.log_l)])
             if myts:
-                return datetime.datetime.fromtimestamp(myts)
+                import dateutil.tz
+                return 
make_datetime_naive(datetime.datetime.fromtimestamp(myts).replace(tzinfo=dateutil.tz.tzlocal()))
             common_debug("No log lines with timestamps found in report")
         except Exception, e:
             common_debug("Error: %s" % (e))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/scripts.py 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/scripts.py
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/scripts.py       
2015-10-20 13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/scripts.py       
2015-10-28 09:51:59.000000000 +0100
@@ -570,7 +570,8 @@
         templatestep = {
             'shortdesc': _strip(''.join(item.xpath('./stepdesc/text()'))),
             'name': item.get('name'),
-            'required': item.get('required'),
+            # Optional steps in the legacy wizards was broken (!?)
+            'required': True, #item.get('required'),
             'parameters': []
         }
         data['steps'].append(templatestep)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/ui_script.py 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/ui_script.py
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/ui_script.py     
2015-10-20 13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/ui_script.py     
2015-10-28 09:51:59.000000000 +0100
@@ -160,6 +160,14 @@
     return ret
 
 
+def _category_pretty(c):
+    if str(c).lower() == 'wizard':
+        return "Wizard (Legacy)"
+    elif str(c).lower() == 'sap':
+        return "SAP"
+    return str(c).capitalize()
+
+
 class Script(command.UI):
     '''
     Cluster scripts can perform cluster-wide configuration,
@@ -193,6 +201,7 @@
                     cat = script['category'].lower()
                     if not all and cat == 'script':
                         continue
+                    cat = _category_pretty(cat)
                     if cat not in categories:
                         categories[cat] = []
                     categories[cat].append("%-16s %s" % (script['name'], 
script['shortdesc']))
@@ -201,7 +210,7 @@
                     continue
             for c, lst in sorted(categories.iteritems(), key=lambda x: x[0]):
                 if c:
-                    print("%s:\n" % (c.capitalize()))
+                    print("%s:\n" % (c))
                 for s in sorted(lst):
                     print(s)
                 print('')
@@ -233,7 +242,7 @@
 
         vals = {
             'name': script['name'],
-            'category': str(script['category']).capitalize(),
+            'category': _category_pretty(script['category']),
             'shortdesc': str(script['shortdesc']),
             'longdesc': scripts.format_desc(script['longdesc']),
             'steps': "\n".join((describe_step([i], [], s, all) for i, s in 
enumerate(script['steps'])))}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/utils.py 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/utils.py
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/modules/utils.py 2015-10-20 
13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/modules/utils.py 2015-10-28 
09:51:59.000000000 +0100
@@ -1025,8 +1025,9 @@
 
 def make_datetime_naive(dt):
     """
-    Ensures that the datetime is
-    not time zone-aware
+    Ensures that the datetime is not time zone-aware:
+
+    The returned datetime object is a naive time in UTC.
     """
     if dt and datetime_is_aware(dt):
         return dt.replace(tzinfo=None) - dt.utcoffset()
@@ -1055,7 +1056,17 @@
     '''
     try:
         import dateutil.parser
+        import dateutil.tz
         dt = dateutil.parser.parse(t)
+
+        if datetime_is_aware(dt):
+            ts = datetime_to_timestamp(dt)
+            if ts is None:
+                return None
+            dt = datetime.datetime.fromtimestamp(ts)
+        else:
+            # convert to UTC from local time
+            dt = make_datetime_naive(dt.replace(tzinfo=dateutil.tz.tzlocal()))
     except ValueError, msg:
         common_err("%s: %s" % (t, msg))
         return None
@@ -1066,11 +1077,6 @@
         except ValueError, msg:
             common_err("no dateutil, please provide times as printed by 
date(1)")
             return None
-    if datetime_is_aware(dt):
-        ts = datetime_to_timestamp(dt)
-        if ts is None:
-            return None
-        dt = datetime.datetime.fromtimestamp(ts)
     return dt
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/requirements.txt 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/requirements.txt
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/requirements.txt 2015-10-20 
13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/requirements.txt 2015-10-28 
09:51:59.000000000 +0100
@@ -1,3 +1,4 @@
 lxml
 PyYAML
 nosexcover
+python-dateutil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/test/testcases/history.exp 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/test/testcases/history.exp
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/test/testcases/history.exp       
2015-10-20 13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/test/testcases/history.exp       
2015-10-28 09:51:59.000000000 +0100
@@ -134,6 +134,7 @@
 Dec 14 20:08:21 xen-d iscsid: iSCSI logger with pid=1682 started!
 Dec 14 20:08:22 xen-d sm-notify[1716]: Version 1.2.3 starting
 Dec 14 20:08:22 xen-d haveged: haveged starting up
+Dec 14 20:08:22 xen-d haveged: arch:        x86 vendor:      amd generic:     
0 i_cache:     64 d_cache:     64 loop_idx:    20 loop_idxmax: 40 loop_sz:     
63724 loop_szmax:  124334 etime:       18207 havege_ndpt  0
 Dec 14 20:08:22 xen-d logd: [1789]: info: setting log facility to daemon
 Dec 14 20:08:22 xen-d logd: [1789]: info: logd started with /etc/logd.cf.
 Dec 14 20:08:22 xen-d iscsid: transport class version 2.0-870. iscsid version 
2.0-872.suse
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/test/testcases/scripts.exp 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/test/testcases/scripts.exp
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/test/testcases/scripts.exp       
2015-10-20 13:14:01.000000000 +0200
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/test/testcases/scripts.exp       
2015-10-28 09:51:59.000000000 +0100
@@ -35,7 +35,7 @@
 ocfs2            OCFS2 filesystem (cloned)
 raid-lvm         RAID hosting LVM
 
-Sap:
+SAP:
 
 sap-as           SAP ASCS Instance
 sap-ci           SAP Central Instance
@@ -80,7 +80,7 @@
 ocfs2            OCFS2 filesystem (cloned)
 raid-lvm         RAID hosting LVM
 
-Sap:
+SAP:
 
 sap-as           SAP ASCS Instance
 sap-ci           SAP Central Instance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-2.2.0~rc3+git.1445338389.7433378/test/unittests/test_time.py 
new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/test/unittests/test_time.py
--- old/crmsh-2.2.0~rc3+git.1445338389.7433378/test/unittests/test_time.py      
1970-01-01 01:00:00.000000000 +0100
+++ new/crmsh-2.2.0~rc3+git.1446022288.cbb7d77/test/unittests/test_time.py      
2015-10-28 09:51:59.000000000 +0100
@@ -0,0 +1,17 @@
+# Copyright (C) 2014 Kristoffer Gronlund <kgronl...@suse.com>
+# See COPYING for license information.
+
+
+from crmsh import utils
+from crmsh import report
+from nose.tools import eq_
+import time
+import datetime
+import dateutil.tz
+
+
+def test_time_convert1():
+    loctz = dateutil.tz.tzlocal()
+    tm = 
time.localtime(utils.datetime_to_timestamp(utils.make_datetime_naive(datetime.datetime(2015,
 6, 1, 10, 0, 0).replace(tzinfo=loctz))))
+    dt = utils.parse_time('Jun 01, 2015 10:00:00')
+    eq_(report.human_date(dt), time.strftime('%Y-%m-%d %H:%M:%S', tm))


Reply via email to