Hello community,

here is the log from the commit of package kubernetes-salt for openSUSE:Factory 
checked in at 2018-05-08 13:37:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kubernetes-salt (Old)
 and      /work/SRC/openSUSE:Factory/.kubernetes-salt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kubernetes-salt"

Tue May  8 13:37:46 2018 rev:17 rq:605055 version:3.0.0+git_r752_f9c2358

Changes:
--------
--- /work/SRC/openSUSE:Factory/kubernetes-salt/kubernetes-salt.changes  
2018-05-04 11:30:54.696658103 +0200
+++ /work/SRC/openSUSE:Factory/.kubernetes-salt.new/kubernetes-salt.changes     
2018-05-08 13:37:58.368182689 +0200
@@ -1,0 +2,11 @@
+Mon May  7 09:18:12 UTC 2018 - containers-bugow...@suse.de
+
+- Commit 8388498 by Alvaro Saurin alvaro.sau...@gmail.com
+ Try to resist existent data in the mine
+ 
+ https://bugzilla.suse.com/show_bug.cgi?id=1091361
+ 
+ bsc#1091361
+
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ kubernetes-salt.spec ++++++
--- /var/tmp/diff_new_pack.pfDTZO/_old  2018-05-08 13:37:59.084156847 +0200
+++ /var/tmp/diff_new_pack.pfDTZO/_new  2018-05-08 13:37:59.088156703 +0200
@@ -32,7 +32,7 @@
 
 Name:           kubernetes-salt
 %define gitrepo salt
-Version:        3.0.0+git_r750_8f19e53
+Version:        3.0.0+git_r752_f9c2358
 Release:        0
 BuildArch:      noarch
 Summary:        Production-Grade Container Scheduling and Management

++++++ master.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/salt-master/pillar/params.sls 
new/salt-master/pillar/params.sls
--- old/salt-master/pillar/params.sls   2018-05-03 12:03:26.000000000 +0200
+++ new/salt-master/pillar/params.sls   2018-05-07 11:18:58.000000000 +0200
@@ -28,6 +28,10 @@
 internal_infra_domain: 'infra.caasp.local'
 ldap_internal_infra_domain: 'dc=infra,dc=caasp,dc=local'
 
+hw:
+  # fallback value when we cannot detect the default interface
+  netiface: 'eth0'
+
 api:
   # the API service IP (must be inside the 'services_cidr')
   cluster_ip:     '172.24.0.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/salt-master/salt/_modules/caasp_net.py 
new/salt-master/salt/_modules/caasp_net.py
--- old/salt-master/salt/_modules/caasp_net.py  2018-05-03 12:03:26.000000000 
+0200
+++ new/salt-master/salt/_modules/caasp_net.py  2018-05-07 11:18:58.000000000 
+0200
@@ -6,6 +6,13 @@
 from __future__ import absolute_import
 
 
+# note: do not import caasp modules other than caasp_log
+from caasp_log import error
+
+
+DEFAULT_INTERFACE = 'eth0'
+
+
 def __virtual__():
     return "caasp_net"
 
@@ -15,15 +22,19 @@
     given an 'iface' (and an optional 'host' and list of 'ifaces'),
     return the IP address associated with 'iface'
     '''
-    if not ifaces:
-        if not host or host == get_nodename():
-            ifaces = __salt__['network.interfaces']()
-        else:
-            ifaces = __salt__['caasp_grains.get'](host, 'network.interfaces', 
type='glob')
-
-    iface = ifaces.get(iface)
-    ipv4addr = iface.get('inet', [{}])
-    return ipv4addr[0].get('address')
+    try:
+        if not ifaces:
+            if not host or host == get_nodename():
+                ifaces = __salt__['network.interfaces']()
+            else:
+                ifaces = __salt__['caasp_grains.get'](host, 
'network.interfaces', type='glob')
+
+        iface = ifaces.get(iface)
+        ipv4addr = iface.get('inet', [{}])
+        return ipv4addr[0].get('address')
+    except Exception as e:
+        error('could not get IP for interface %s: %s', iface, e)
+        return ''
 
 
 def get_primary_iface(host=None):
@@ -31,12 +42,16 @@
     (given some optional 'host')
     return the name of the primary iface (the iface associated with the 
default route)
     '''
-    if not host or host == get_nodename():
-        default_route_lst = __salt__['network.default_route']()
-        return default_route_lst[0]['interface']
-    else:
-        all_routes = __salt__['caasp_grains.get'](host, 
'network.default_route', type='glob')
-        return all_routes[host][0]['interface']
+    try:
+        if not host or host == get_nodename():
+            default_route_lst = __salt__['network.default_route']()
+            return default_route_lst[0]['interface']
+        else:
+            all_routes = __salt__['caasp_grains.get'](host, 
'network.default_route', type='glob')
+            return all_routes[host][0]['interface']
+    except Exception as e:
+        error('could not get the primary interface: %s', e)
+        return __salt__['caasp_pillar.get']('hw:netiface', DEFAULT_INTERFACE)
 
 
 def get_primary_ip(host=None, ifaces=None):
@@ -52,9 +67,13 @@
     given a compound expression 'compound', return the primary IPs for all the
     nodes that match that expression
     '''
-    res = []
-    all_ifaces = __salt__['caasp_grains.get'](compound, 'network.interfaces')
-    return [get_primary_ip(host=host, **kwargs) for host in all_ifaces.keys()]
+    try:
+        res = []
+        all_ifaces = __salt__['caasp_grains.get'](compound, 
'network.interfaces')
+        return [get_primary_ip(host=host, **kwargs) for host in 
all_ifaces.keys()]
+    except Exception as e:
+        error('could not get primary IPs for %s: %s', compound, e)
+        return []
 
 
 def get_nodename(host=None, **kwargs):
@@ -62,9 +81,13 @@
     (given some optional 'host')
     return the `nodename`
     '''
-    if not host:
-        assert __opts__['__role'] != 'master'
-        return __salt__['grains.get']('nodename')
-    else:
-        all_nodenames = __salt__['caasp_grains.get'](host, 'nodename', 
type='glob')
-        return all_nodenames[host]
+    try:
+        if not host:
+            assert __opts__['__role'] != 'master'
+            return __salt__['grains.get']('nodename')
+        else:
+            all_nodenames = __salt__['caasp_grains.get'](host, 'nodename', 
type='glob')
+            return all_nodenames[host]
+    except Exception as e:
+        error('could not get nodename: %s', e)
+        return ''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/salt-master/salt/etc-hosts/hosts.jinja 
new/salt-master/salt/etc-hosts/hosts.jinja
--- old/salt-master/salt/etc-hosts/hosts.jinja  2018-05-03 12:03:26.000000000 
+0200
+++ new/salt-master/salt/etc-hosts/hosts.jinja  2018-05-07 11:18:58.000000000 
+0200
@@ -11,15 +11,20 @@
 {%- macro nodes_entries(expr) -%}
   {%- set nodes = salt['mine.get'](expr, 'network.interfaces', 'compound') %}
   {%- for id, ifaces in nodes.items() %}
-    {%- set ip = salt.caasp_net.get_primary_ip(host=id, ifaces=ifaces)%}
-    {%- set nodename = salt.caasp_net.get_nodename(host=id) %}
-    {%- set ns = nodename + ' ' +
-                 nodename + '.' + pillar['internal_infra_domain'] + ' ' +
-                 id + ' ' +
-                 id + '.' + pillar['internal_infra_domain'] %}
+    {%- set ip = salt.caasp_net.get_primary_ip(host=id, ifaces=ifaces) %}
+    {%- if ip|length > 0 %}
+      {%- set nodename = salt.caasp_net.get_nodename(host=id) %}
+      {%- if nodename|length > 0 %}
+        {%- set ns = nodename + ' ' +
+                   nodename + '.' + pillar['internal_infra_domain'] + ' ' +
+                   id + ' ' +
+                   id + '.' + pillar['internal_infra_domain'] %}
 
 {{ ip }} {{ ns }}
 
+      {%- endif %}
+    {%- endif %}
+
     {%- if id == this_id %}
 # try to make Salt happy by adding an ipv6 entry
 # for the local host (not really used for anything else)


Reply via email to