update to 2.1.fb26-2

Signed-off-by: Andy Grover <agrover@redhat.com>
This commit is contained in:
Andy Grover 2013-06-18 10:53:48 -07:00
parent d1e89bedb9
commit a8fc80634b
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,31 @@
commit a221a535d718c3abbc53ee44713188d70db65a7d
Author: Andy Grover <agrover@redhat.com>
Date: Tue Jun 18 10:49:50 2013 -0700
Catch module load errors
If targetcli is not run for the first time not as root, refresh() will
fail because it can't load modules. This returns a nicer error message
in that case.
See https://bugzilla.redhat.com/show_bug.cgi?id=973852
Signed-off-by: Andy Grover <agrover@redhat.com>
diff --git a/scripts/targetcli b/scripts/targetcli
index a2cbff1..269dc1a 100755
--- a/scripts/targetcli
+++ b/scripts/targetcli
@@ -64,8 +64,11 @@ def main():
try:
root_node.refresh()
- except RTSLibError, error:
+ except Exception, error:
shell.con.display(shell.con.render_text(str(error), 'red'))
+ if not is_root:
+ shell.con.display(shell.con.render_text("Retry as root.", 'red'))
+ sys.exit(-1)
if len(sys.argv) > 1:
shell.run_cmdline(" ".join(sys.argv[1:]))

View File

@ -5,10 +5,11 @@ License: AGPLv3
Group: System Environment/Libraries
Summary: An administration shell for storage targets
Version: 2.1.fb26
Release: 1%{?dist}
Release: 2%{?dist}
URL: https://fedorahosted.org/targetcli-fb/
Source: https://fedorahosted.org/released/targetcli-fb/%{oname}-%{version}.tar.gz
Source1: targetcli.service
Patch0: %{name}-modules-not-loaded.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel python-configshell python-ethtool epydoc
@ -28,6 +29,7 @@ users will also need to install and use fcoe-utils.
%prep
%setup -q -n %{oname}-%{version}
%patch0 -p1
%build
%{__python} setup.py build
@ -65,6 +67,10 @@ rm -rf %{buildroot}
%{_mandir}/man8/targetcli.8.gz
%changelog
* Mon Jun 18 2013 Andy Grover <agrover@redhat.com> - 2.1.fb26-2
- Add patch
* modules-not-loaded.patch
* Fri Jun 7 2013 Andy Grover <agrover@redhat.com> - 2.1.fb26-1
- New upstream release