Revision a62d1901
b/qa/qa_cluster.py | ||
---|---|---|
61 | 61 |
master = qa_config.GetMasterNode() |
62 | 62 |
|
63 | 63 |
# First create the RAPI credentials |
64 |
cred_string = "%s %s write" % (rapi_user, rapi_secret) |
|
65 |
cmd = ("echo %s > %s" % |
|
66 |
(utils.ShellQuote(cred_string), |
|
67 |
utils.ShellQuote(constants.RAPI_USERS_FILE))) |
|
68 |
AssertEqual(StartSSH(master['primary'], cmd).wait(), 0) |
|
64 |
fh = tempfile.NamedTemporaryFile() |
|
65 |
try: |
|
66 |
fh.write("%s %s write\n" % (rapi_user, rapi_secret)) |
|
67 |
fh.flush() |
|
68 |
|
|
69 |
tmpru = qa_utils.UploadFile(master["primary"], fh.name) |
|
70 |
try: |
|
71 |
cmd = ["mv", tmpru, constants.RAPI_USERS_FILE] |
|
72 |
AssertEqual(StartSSH(master["primary"], |
|
73 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
74 |
finally: |
|
75 |
cmd = ["rm", "-f", tmpru] |
|
76 |
AssertEqual(StartSSH(master["primary"], |
|
77 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
78 |
finally: |
|
79 |
fh.close() |
|
69 | 80 |
|
81 |
# Initialize cluster |
|
70 | 82 |
cmd = ['gnt-cluster', 'init'] |
71 | 83 |
|
72 | 84 |
if master.get('secondary', None): |
Also available in: Unified diff