integ/python/python-smartpm/centos/patches/smart-yaml-error.patch
Scott Little bab9bb6b69 Internal restructuring of stx-integ
Create new directories:
   ceph
   config
   config-files
   filesystem
   kernel
   kernel/kernel-modules
   ldap
   logging
   strorage-drivers
   tools
   utilities
   virt

Retire directories:
   connectivity
   core
   devtools
   support
   extended

Delete two packages:
   tgt
   irqbalance

Relocated packages:
   base/
      dhcp
      initscripts
      libevent
      lighttpd
      linuxptp
      memcached
      net-snmp
      novnc
      ntp
      openssh
      pam
      procps
      sanlock
      shadow
      sudo
      systemd
      util-linux
      vim
      watchdog

   ceph/
      python-cephclient

   config/
      facter
      puppet-4.8.2
      puppet-modules

   filesystem/
      e2fsprogs
      nfs-utils
      nfscheck

   kernel/
      kernel-std
      kernel-rt

   kernel/kernel-modules/
      mlnx-ofa_kernel

   ldap/
      nss-pam-ldapd
      openldap

   logging/
      syslog-ng
      logrotate

   networking/
      lldpd
      iproute
      mellanox
      python-ryu
      mlx4-config

   python/
      python-2.7.5
      python-django
      python-gunicorn
      python-setuptools
      python-smartpm
      python-voluptuous

   security/
      shim-signed
      shim-unsigned
      tboot

   strorage-drivers/
      python-3parclient
      python-lefthandclient

   virt/
      cloud-init
      libvirt
      libvirt-python
      qemu

   tools/
      storage-topology
      vm-topology

   utilities/
      tis-extensions
      namespace-utils
      nova-utils
      update-motd

Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 10:06:31 -04:00

87 lines
2.8 KiB
Diff

Print a more friendly error if YAML output is requested without PyYAML
Upstream-Status: Pending
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
diff --git a/smart/commands/channel.py b/smart/commands/channel.py
index 63fbb35..108f3f1 100644
--- a/smart/commands/channel.py
+++ b/smart/commands/channel.py
@@ -339,7 +339,10 @@ def main(ctrl, opts):
print
if opts.yaml is not None:
- import yaml
+ try:
+ import yaml
+ except ImportError:
+ raise Error, _("Please install PyYAML in order to use this function")
yamlchannels = {}
for alias in (opts.yaml or sysconf.get("channels", ())):
channel = sysconf.get(("channels", alias))
diff --git a/smart/commands/config.py b/smart/commands/config.py
index 4fe4366..aa1db78 100644
--- a/smart/commands/config.py
+++ b/smart/commands/config.py
@@ -137,7 +137,10 @@ def main(ctrl, opts):
pprint.pprint(sysconf.get((), hard=True))
if opts.yaml is not None:
- import yaml
+ try:
+ import yaml
+ except ImportError:
+ raise Error, _("Please install PyYAML in order to use this function")
if opts.yaml:
marker = object()
for opt in opts.yaml:
diff --git a/smart/commands/flag.py b/smart/commands/flag.py
index ed18999..8b90496 100644
--- a/smart/commands/flag.py
+++ b/smart/commands/flag.py
@@ -138,7 +138,10 @@ def main(ctrl, opts):
print
if opts.yaml is not None:
- import yaml
+ try:
+ import yaml
+ except ImportError:
+ raise Error, _("Please install PyYAML in order to use this function")
yamlflags = {}
for flag in opts.yaml or pkgconf.getFlagNames():
flag = flag.strip()
diff --git a/smart/commands/mirror.py b/smart/commands/mirror.py
index ca50a95..f7b019d 100644
--- a/smart/commands/mirror.py
+++ b/smart/commands/mirror.py
@@ -218,7 +218,10 @@ def main(ctrl, opts):
print
if opts.yaml:
- import yaml
+ try:
+ import yaml
+ except ImportError:
+ raise Error, _("Please install PyYAML in order to use this function")
yamlmirrors = {}
mirrors = sysconf.get("mirrors", ())
for origin in mirrors:
diff --git a/smart/commands/priority.py b/smart/commands/priority.py
index d850d29..441ea32 100644
--- a/smart/commands/priority.py
+++ b/smart/commands/priority.py
@@ -117,7 +117,10 @@ def main(ctrl, opts):
print
elif opts.yaml:
- import yaml
+ try:
+ import yaml
+ except ImportError:
+ raise Error, _("Please install PyYAML in order to use this function")
yamlpriorities = {}
priorities = sysconf.get("package-priorities", {})
for name in opts.args or priorities: