Skip to content

Commit

Permalink
arg unpacking for nested value retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimsonK1ng committed Oct 2, 2019
1 parent 7a96111 commit c14f30d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Reconnoitre/lib/file_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def write_recommendations(results, ip_address, outputdir):
f.close()


def get_config_options(key, option):
def get_config_options(key, *args):
__location__ = os.path.realpath(
os.path.join(
os.getcwd(),
Expand All @@ -161,13 +161,9 @@ def get_config_options(key, option):
"%(outputdir)s"))

res = j.get(key, None)
for arg in args:
res = res.get(arg, None)
if res is None:
raise KeyError

if res is None:
raise KeyError

res2 = res.get(option, None)

if res2 is None:
raise KeyError

return res2
return res

0 comments on commit c14f30d

Please sign in to comment.