[PATCH] Fix a undefined error
Bian Naimeng
biannm at cn.fujitsu.com
Thu Nov 19 21:58:48 PST 2015
LOCKED_KEEP is undefined, so the following error will be caught.
/usr/lib/python2.7/site-packages/smart/transaction.py", line 1190, in run
locked[pkg] = (LOCKED_KEEP, None)
NameError: global name 'LOCKED_KEEP' is not defined
Signed-off-by: Bian Naimeng <biannm at cn.fujitsu.com>
---
smart/const.py | 1 +
smart/transaction.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/smart/const.py b/smart/const.py
index 3a01073..9930139 100644
--- a/smart/const.py
+++ b/smart/const.py
@@ -77,5 +77,6 @@ LOCKED_CONFLICT = Enum('LOCKED_CONFLICT')
LOCKED_CONFLICT_BY = Enum('LOCKED_CONFLICT_BY')
LOCKED_NO_COEXIST = Enum('LOCKED_NO_COEXIST')
LOCKED_SYSCONF = Enum('LOCKED_SYSCONF')
+LOCKED_KEEP = Enum('LOCKED_KEEP')
# vim:ts=4:sw=4:et
diff --git a/smart/transaction.py b/smart/transaction.py
index 4b90cb7..0d9c39d 100644
--- a/smart/transaction.py
+++ b/smart/transaction.py
@@ -19,7 +19,7 @@
# along with Smart Package Manager; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_EXCLUDE, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
+from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_EXCLUDE, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE, LOCKED_KEEP
from smart.cache import PreRequires, Package
from smart import *
--
1.9.1
More information about the Smart
mailing list