#189 Port generate-oidc-token to python3
Merged 3 years ago by pingou. Opened 3 years ago by bmwiedemann.
fedora-infra/ bmwiedemann/ansible python3  into  master

Port generate-oidc-token to python3
Bernhard M. Wiedemann • 3 years ago  
file modified
+5 -5
@@ -1,4 +1,4 @@ 

- #!/usr/bin/python2

+ #!/usr/bin/python3

  # Copyright (c) 2018 Red Hat, Inc.

  #

  # This program is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@ 

  import click

  

  

- secret = base64.urlsafe_b64encode(os.urandom(64))[:64]

+ secret = base64.urlsafe_b64encode(os.urandom(64))[:64].decode()

  

  

  template = """
@@ -87,10 +87,10 @@ 

          scope.insert(0, 'openid')

      scope = json.dumps(scope)

  

-     print template.format(uuid=identifier, service_name=service_name, secret=secret,

-                           expiration=expiration, scope=scope, now=now)

+     print(template.format(uuid=identifier, service_name=service_name, secret=secret,

+                           expiration=expiration, scope=scope, now=now))

  

-     print "Token: {}_{}\n".format(identifier, secret)

+     print("Token: {}_{}\n".format(identifier, secret))

  

  

  if __name__ == '__main__':

python2 is already end-of-life

rebased onto f312bfed276178b1c977910f72197179c4627300

3 years ago

rebased onto 8f2bf8b49a1c889d05b7372507809da4ccf0fa9f

3 years ago

rebased onto d0ea055

3 years ago

rebased onto d0ea055

3 years ago

Pull-Request has been merged by pingou

3 years ago