Fix get-credentials subcommand 62/13062/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 18 Oct 2018 17:39:59 +0000 (13:39 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 18 Oct 2018 17:44:25 +0000 (13:44 -0400)
When we refactored the Jenkins module in
I2168adf9bc992b719da6c0350a446830015e6df6 we forgot to refactor
the get-credentials command so it broke.

Change-Id: I1ee04d2753327557e4d7e5e017a3d6ca7741fef0
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
lftools/cli/jenkins/__init__.py
releasenotes/notes/fix-get-credentials-6759fee7366c5602.yaml [new file with mode: 0644]

index 681d1f1..25905ca 100644 (file)
@@ -45,7 +45,7 @@ def jenkins_cli(ctx, server, user, password):
 @click.pass_context
 def get_credentials(ctx):
     """Print all available Credentials."""
-    server = ctx.obj['server']
+    jenkins = ctx.obj['jenkins']
     groovy_script = """
 import com.cloudbees.plugins.credentials.*
 
@@ -63,7 +63,7 @@ for (c in creds) {
     } catch (MissingPropertyException) {}
 }
 """
-    result = server.run_script(groovy_script)
+    result = jenkins.server.run_script(groovy_script)
     log.info(result)
 
 
diff --git a/releasenotes/notes/fix-get-credentials-6759fee7366c5602.yaml b/releasenotes/notes/fix-get-credentials-6759fee7366c5602.yaml
new file mode 100644 (file)
index 0000000..dc916d9
--- /dev/null
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    The get-credentials command is now fixed since it was was broken after
+    refactoring done in Gerrit patch I2168adf9bc992b719da6c0350a446830015e6df6.