Fix minor issues. 67/11467/2
authorJohn DeNisco <jdenisco@cisco.com>
Fri, 30 Mar 2018 14:50:19 +0000 (10:50 -0400)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 30 Mar 2018 20:46:03 +0000 (20:46 +0000)
Change-Id: I1ce5106d99dd4d4b1c033d4873b4511e9a170afc
Signed-off-by: John DeNisco <jdenisco@cisco.com>
extras/vpp_config/data/auto-config.yaml
extras/vpp_config/setup.py
extras/vpp_config/vpp_config.py
extras/vpp_config/vpplib/VPPUtil.py

index 83e3aab..129da3f 100644 (file)
@@ -2,7 +2,7 @@ metadata: {system_config_file: /vpp/vpp-config/configs/system-config.yaml, versi
 nodes:
   DUT1:
     cpu: {grub_config_file: /vpp/vpp-config/dryrun/default/grub, reserve_vpp_main_core: false,
-      total_other_cpus: 0, total_vpp_cpus: 0}
+      total_other_cpus: 0, total_vpp_cpus: 0, total_rx_queues: 1}
     host: localhost
     hugepages: {hugepage_config_file: /vpp/vpp-config/dryrun/sysctl.d/80-vpp.conf,
       total: '1024'}
index 8198193..99d0ee2 100644 (file)
@@ -1,7 +1,7 @@
 from setuptools import setup
 
 setup(name="vpp_config",
-      version="18.01.5",
+      version="18.01.11",
       author="John DeNisco",
       author_email="jdenisco@cisco.com",
       description="VPP Configuration Utility",
index d9d6584..a5d57bf 100755 (executable)
@@ -660,7 +660,7 @@ def autoconfig_setup(ask_questions=True):
         cmd = 'modprobe uio_pci_generic'
         (ret, stdout, stderr) = VPPUtil.exec_command(cmd)
         if ret != 0:
-            raise RuntimeError('{} failed on node {} {}'. format(cmd, node['host'], stderr))
+            logging.warning('{} failed on node {} {}'. format(cmd, node['host'], stderr))
 
 
 # noinspection PyUnresolvedReferences
index 07d65b0..6f13a43 100644 (file)
@@ -145,6 +145,8 @@ class VPPUtil(object):
         # reps += 'repositories/fd.io.stable.{}.ubuntu.{}.main/ ./\n'.format(fdio_release, ubuntu_version)
         # When using release
         reps += 'repositories/fd.io.ubuntu.{}.main/ ./\n'.format(ubuntu_version)
+        # When using master
+        # reps += 'repositories/fd.io.master.ubuntu.{}.main/ ./\n'.format(ubuntu_version)
 
         cmd = 'echo "{0}" | sudo tee {1}'.format(reps, sfile)
         (ret, stdout, stderr) = self.exec_command(cmd)
@@ -202,12 +204,18 @@ class VPPUtil(object):
                 node['host'],
                 stderr))
 
-        reps = '[fdio-stable-{}]\n'.format(fdio_release)
-        reps += 'name=fd.io stable/{} branch latest merge\n'.format(fdio_release)
+        # Latest
+        # reps = '[fdio-master]\n'
+        # reps += 'name=fd.io master branch latest merge\n'
+        # reps += 'baseurl=https://nexus.fd.io/content/repositories/fd.io.master.{}/\n'.format(centos_version)
+        # reps = '[fdio-stable-{}]\n'.format(fdio_release)
+        # reps += 'name=fd.io stable/{} branch latest merge\n'.format(fdio_release)
         # When using stable
         # reps += 'baseurl=https://nexus.fd.io/content/repositories/fd.io.stable.{}.{}/\n'.\
         #     format(fdio_release, centos_version)
         # When using release
+        reps = '[fdio-release]\n'
+        reps += 'name=fd.io release branch latest merge\n'
         reps += 'baseurl=https://nexus.fd.io/content/repositories/fd.io.{}/\n'.format(centos_version)
         reps += 'enabled=1\n'
         reps += 'gpgcheck=0'
@@ -240,13 +248,17 @@ class VPPUtil(object):
         :type node: dict
         """
         distro = self.get_linux_distro()
+        logging.info("  {}".format(distro[0]))
         if distro[0] == 'Ubuntu':
+            logging.info("Install Ubuntu")
             self._install_vpp_ubuntu(node)
         elif distro[0] == 'CentOS Linux':
             logging.info("Install CentOS")
             self._install_vpp_centos(node)
         else:
-            return
+            logging.info("Install CentOS (default)")
+            self._install_vpp_centos(node)
+        return
 
     def _uninstall_vpp_pkg_ubuntu(self, node, pkg):
         """
@@ -348,11 +360,14 @@ class VPPUtil(object):
 
         distro = self.get_linux_distro()
         if distro[0] == 'Ubuntu':
+            logging.info("Uninstall Ubuntu")
             self._uninstall_vpp_ubuntu(node)
         elif distro[0] == 'CentOS Linux':
             logging.info("Uninstall CentOS")
             self._uninstall_vpp_centos(node)
         else:
+            logging.info("Uninstall CentOS (Default)")
+            self._uninstall_vpp_centos(node)
             return
 
     def show_vpp_settings(self, *additional_cmds):
@@ -574,6 +589,7 @@ class VPPUtil(object):
         elif distro[0] == 'CentOS Linux':
             pkgs = self._get_installed_vpp_pkgs_centos()
         else:
+            pkgs = self._get_installed_vpp_pkgs_centos()
             return []
 
         return pkgs
@@ -712,7 +728,7 @@ class VPPUtil(object):
         distro = platform.linux_distribution()
         if distro[0] == 'Ubuntu' or \
                         distro[0] == 'CentOS Linux' or \
-                        distro[:26] == 'Linux Distribution Red Hat':
+                        distro[:7] == 'Red Hat':
             return distro
         else:
             raise RuntimeError('Linux Distribution {} is not supported'.format(distro[0]))
@@ -792,4 +808,4 @@ class VPPUtil(object):
                 ifaces.append(ifcidx)
 
         print stdout
-        return ifaces
\ No newline at end of file
+        return ifaces