Skip to content
Snippets Groups Projects
Commit 49ceab21 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

QA: Fix upload of RAPI users file


After moving the users file to a directory, we must ensure the
directory exists.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent c744425f
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@
"""
import tempfile
import os.path
from ganeti import constants
from ganeti import utils
......@@ -56,6 +57,8 @@ def TestClusterInit(rapi_user, rapi_secret):
"""gnt-cluster init"""
master = qa_config.GetMasterNode()
rapi_dir = os.path.dirname(constants.RAPI_USERS_FILE)
# First create the RAPI credentials
fh = tempfile.NamedTemporaryFile()
try:
......@@ -64,6 +67,7 @@ def TestClusterInit(rapi_user, rapi_secret):
tmpru = qa_utils.UploadFile(master["primary"], fh.name)
try:
AssertCommand(["mkdir", "-p", rapi_dir])
AssertCommand(["mv", tmpru, constants.RAPI_USERS_FILE])
finally:
AssertCommand(["rm", "-f", tmpru])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment