|
2 | 2 |
|
3 | 3 | ################################################################################################# |
4 | 4 | # |
5 | | -# rallyfire - Examplar script to test the basic connectivity to a Rally server |
| 5 | +# rallyfire - Exemplar script to test the basic connectivity to a Rally server |
6 | 6 | # and obtain basic workspace and project information |
7 | 7 | # |
8 | 8 | ################################################################################################# |
9 | 9 |
|
10 | 10 | import sys |
11 | 11 |
|
12 | | -from pyral import Rally, rallySettings |
| 12 | +from pyral import Rally, rallyWorkset |
13 | 13 |
|
14 | 14 | ################################################################################################# |
15 | 15 |
|
|
20 | 20 | def main(args): |
21 | 21 | options = [opt for opt in args if opt.startswith('--')] |
22 | 22 | args = [arg for arg in args if arg not in options] |
23 | | - server, user, password, workspace, project = rallySettings(options) |
| 23 | + server, user, password, apikey, workspace, project = rallyWorkset(options) |
24 | 24 | print " ".join(["|%s|" % item for item in [server, user, password, workspace, project]]) |
| 25 | + # If you want to use BasicAuth, use the following form |
25 | 26 | rally = Rally(server, user, password, workspace=workspace, project=project) |
26 | | - #rally = Rally(server, user, password, debug=True) |
| 27 | + # If you want to use API Key, you can use the following form |
| 28 | + #rally = Rally(server, apikey=apikey, workspace=workspace, project=project) |
27 | 29 | rally.enableLogging('fire.log') |
| 30 | + # the following form of obtaining a Rally instance will use the apikey if it is present (non None) |
| 31 | + # otherwise it will use the user and password for BasicAuth |
28 | 32 | # add in the debug=True keyword arg if you want more verbiage ... |
29 | | - #rally = Rally(server, user, password, workspace=workspace, project=project, debug=True) |
| 33 | + #rally = Rally(server, user, password, apikey=apikey, workspace=workspace, project=project, debug=True) |
30 | 34 | specified_workspace = workspace |
31 | 35 |
|
32 | 36 | workspace = rally.getWorkspace() |
33 | 37 | print "Workspace: %s " % workspace.Name |
34 | 38 | if specified_workspace != workspace.Name: |
35 | | - print " ** The workspace you specified: %s is not a valid workspace name for your account, using your default workspace instead" % specified_workspace |
| 39 | + print " ** The workspace you specified: %s is not a valid workspace name for your account, using your default workspace instead" % specified_workspace |
36 | 40 | #print "Workspace: %12.12s %-18.18s (%s)" % (workspace.oid, workspace.Name, workspace.ref) |
37 | 41 |
|
38 | 42 | project = rally.getProject() |
|
0 commit comments