Skip to content

Commit

Permalink
Merge pull request #17 from brianhlin/sw2405_text_fixes
Browse files Browse the repository at this point in the history
Various text fixes
  • Loading branch information
brianhlin authored Aug 11, 2016
2 parents a6287ab + 09f16e9 commit 6a74f33
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
4 changes: 3 additions & 1 deletion osgpkitools/OSGPKIUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def print_failure_reason_exit(data):
# provide a VO in their request. We cannot handle this in the arg parsing
# because not all domains require VO information (SOFTWARE-2292)
if re.search(r'Couldn\'t find GridAdmin group under specified VO', msg):
msg = "Failed to request certificate due to missing VO information. Did you forget to specify the -v/--vo option?"
msg = "Failed to request certificate due to bad VO information. " + \
"Did you specify an acceptable VO for your requested domain? " + \
"See http://oim.opensciencegrid.org/oim/gridadmin for a list of VOs per domain"
separator = '='*80
sys.exit('\n'.join(textwrap.wrap(separator + msg, width=80)))

Expand Down
3 changes: 1 addition & 2 deletions osgpkitools/osg-cert-request
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def parse_args():
'--outkeyfile',
action='store',
dest='keyfile',
help='Specify the output filename for the retrieved user certificate.\
\nDefault is ./hostkey.pem',
help='Specify the output filename for the retrieved user certificate. Default is ./hostkey.pem',
metavar='OUTPUT KEYFILE',
default='hostkey.pem',
)
Expand Down
2 changes: 1 addition & 1 deletion osgpkitools/osg-gridadmin-cert-request
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def parse_args():
in a dictionary that is used throughout the script."""

usage = \
'usage: %prog [options] arg\nUsage:%prog -h/--help [for detailed explanations of options]'
'usage: %prog [options] arg\nUsage: %prog -h/--help [for detailed explanations of options]'
parser = OptionParser(usage)
group = OptionGroup(parser, 'Hostname Options',
'''Use either of these options.
Expand Down
6 changes: 3 additions & 3 deletions osgpkitools/osg-user-cert-renew
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_args():
in a dictionary that is used throughout the script."""

usage = \
'usage: %prog [options]\nUsage:%prog -h/--help [for detailed explanations of options]'
'usage: %prog [options]\nUsage: %prog -h/--help [for detailed explanations of options]'
parser = OptionParser(usage)
parser.add_option(
'-k',
Expand All @@ -53,8 +53,8 @@ def parse_args():
'--cert',
action='store',
dest='usercert',
help="Specify Requestor's certificate (PEM Format).\n If not specified\
will take the value of X509_USER_CERT or $HOME/.globus/usercert.pem",
help="Specify Requestor's certificate (PEM Format). If not specified \
will take the value of X509_USER_CERT or $HOME/.globus/usercert.pem",
default=None,
metavar='CERT',
)
Expand Down
9 changes: 3 additions & 6 deletions tests/OSGPKIUtilsTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_sigalrm_handler(self):
'''Verify exiting handler'''
self.assertRaises(SystemExit, OSGPKIUtils.start_timeout_clock, 0)

def test_missing_vo_msg(self):
def test_missing_vo_exception(self):
'''Verify helpful error message when user fails to include necessary VO information.'''
response = dumps({'status': 'FAILED',
'detail': ' -- '.join(["Failed to find GridAdmins for specified CSRs/VO",
Expand All @@ -66,11 +66,8 @@ def test_missing_vo_msg(self):
"https://ticket.grid.iu.edu"])})
try:
OSGPKIUtils.print_failure_reason_exit(response)
except SystemExit, exc:
self.assertEqual(exc.message.replace('\n', ' '),
"="*80 + " Failed to request certificate due to missing VO information. " + \
"Did you forget to specify the -v/--vo option?")#,
# "print_failure_reason_exit() did not fail with missing VO error message")
except SystemExit:
pass
else:
self.fail("print_failure_reason_exit() did not raise SystemExit")

Expand Down

0 comments on commit 6a74f33

Please sign in to comment.