Permalink
Browse files

Merge pull request #230 from fedora-infra/feature/fix-config-query

Feature/fix config query
  • Loading branch information...
2 parents aaf3362 + b7a85a3 commit 85fc2fd048a93b61fd88cf38046a2c3f3a291542 @ralphbean ralphbean committed Feb 28, 2014
Showing with 8 additions and 3 deletions.
  1. +5 −1 fedmsg/commands/config.py
  2. +0 −1 fedmsg/core.py
  3. +3 −1 fedmsg/tests/test_commands.py
@@ -91,7 +91,11 @@ def config():
cur = config
if args.query:
- cur = fedmsg.utils.dict_query(cur, args.query)
+ cur = fedmsg.utils.dict_query(cur, args.query)[args.query]
+ if cur is None:
+ print >>sys.stderr, (
+ "Key `%s` does not exist in config" % args.query)
+ sys.exit(1)
if isinstance(cur, list):
for i in cur:
View
@@ -19,7 +19,6 @@
#
import getpass
-import inspect
import socket
import threading
import datetime
@@ -230,7 +230,9 @@ def test_config_query_broken(self, stderr, stdout, argv):
except SystemExit as exc:
eq_(exc.code, 1)
else:
- assert False
+ output = "output: %r, error: %r" % (
+ stdout.getvalue(), stderr.getvalue())
+ assert False, output
output = stdout.getvalue()
error = stderr.getvalue()

0 comments on commit 85fc2fd

Please sign in to comment.