Skip to content

Commit

Permalink
Use find() properly.
Browse files Browse the repository at this point in the history
It returns -1 when the search string isn't found.
  • Loading branch information
bobveznat committed Mar 16, 2015
1 parent a7e353d commit 81f8e34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/get_cert
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_cert_metadata(cert_path):
proc = subprocess.Popen(['/usr/bin/ssh-keygen', '-L', '-f', cert_path],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

if proc.stderr.read().find('is not a public key'):
if proc.stderr.read().find('is not a public key') != -1:
print "Invalid signed ssh certificate file: %s" % (cert_path,)
sys.exit(1)

Expand Down

0 comments on commit 81f8e34

Please sign in to comment.