Skip to content

Commit 6d3bbca

Browse files
committed
provisioning: Don't pull git as root.
1 parent 0cc4d66 commit 6d3bbca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: provisioning/provision_stage_2.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,10 @@ def main():
957957

958958
result = {"start": now()}
959959

960+
git_user = None
961+
if len(sys.argv) == 2:
962+
git_user = sys.argv[1]
963+
960964
with urllib.request.urlopen("https://download.tinkerforge.com/latest_versions.txt") as f:
961965
latest_versions = f.read().decode("utf-8")
962966

@@ -1150,9 +1154,11 @@ def main():
11501154

11511155
print("Checking if EVSE was tested...")
11521156
if not exists_evse_test_report(result["evse_uid"]):
1157+
if git_user is None:
1158+
fatal_error("No test report found for EVSE {} and git username is unknown. Please pull the wallbox git.".format(result["evse_uid"]))
11531159
print("No test report found. Checking for new test reports...")
11541160
with ChangedDirectory(os.path.join("..", "..", "wallbox")):
1155-
run(["git", "pull"])
1161+
run(["su", git_user, "-c", "git pull"])
11561162
if not exists_evse_test_report(result["evse_uid"]):
11571163
fatal_error("No test report found for EVSE {}.".format(result["evse_uid"]))
11581164

0 commit comments

Comments
 (0)