Skip to content

Commit

Permalink
Changed return value to provide helpful message
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTruncer committed Apr 6, 2015
1 parent c330934 commit 5599170
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hash_ops/cisco_pix.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def __init__(self):
def generate(self, cli_object):
if cli_object.username is None:
print "You must provide a username for cisco_pix hashes!"
return "<Needs username>"
return "Cisco_pix hashes require a username"
generatedhash = cisco_pix.encrypt(cli_object.plaintext, user=cli_object.username)
return generatedhash
2 changes: 1 addition & 1 deletion hash_ops/msdcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def __init__(self):
def generate(self, cli_object):
if cli_object.username is None:
print "You must provide a username for msdcc hashes!"
sys.exit()
return "MSDCC hashes require a username"
generatedhash = msdcc.encrypt(cli_object.plaintext, user=cli_object.username)
return generatedhash
4 changes: 2 additions & 2 deletions hash_ops/msdcc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self):

def generate(self, cli_object):
if cli_object.username is None:
print "You must provide a username for msdcc hashes!"
return "<Needs username>"
print "You must provide a username for msdcc2 hashes!"
return "MSDCC2 Hashes require a username"
generatedhash = msdcc2.encrypt(cli_object.plaintext, user=cli_object.username)
return generatedhash
3 changes: 1 addition & 2 deletions hash_ops/oracle10.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
This module generates md5 hashes
'''

import sys
from passlib.hash import oracle10


Expand All @@ -15,6 +14,6 @@ def __init__(self):
def generate(self, cli_object):
if cli_object.username is None:
print "You must provide a username for oracle10 hashes!"
sys.exit()
return "Oracle10 Hashes require a username"
generatedhash = oracle10.encrypt(cli_object.plaintext, user=cli_object.username)
return generatedhash
2 changes: 1 addition & 1 deletion hash_ops/postgres_md5.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def __init__(self):
def generate(self, cli_object):
if cli_object.username is None:
print "You must provide a username for postgres_md5 hashes!"
sys.exit()
return "Postgres_md5 Hashes require a username"
generatedhash = postgres_md5.encrypt(cli_object.plaintext, user=cli_object.username)
return generatedhash

0 comments on commit 5599170

Please sign in to comment.