Skip to content

Commit

Permalink
fix: storage controller registration script
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulinux committed Mar 4, 2024
1 parent 3fbbb09 commit 1f31c6d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_data(url, token, host=None):
def get_pageserver_id(url, token):
data = get_data(url, token, HOST)
if "node_id" in data:
return data["node_id"]
return int(data["node_id"])


def get_pageserver_version():
Expand Down Expand Up @@ -97,7 +97,7 @@ def register(url, token, payload):
response = json.loads(resp.read())
log.info(response)
if "node_id" in response:
return response["node_id"]
return int(response["node_id"])


if __name__ == "__main__":
Expand Down Expand Up @@ -152,8 +152,8 @@ def register(url, token, payload):
log.info("check if pageserver already registered or not in cplane")
node_id_in_cplane = get_pageserver_id(LOCAL_CPLANE_URL, LOCAL_CPLANE_JWT_TOKEN)

if node_id_in_cplane is None:
PAYLOAD.update(dict(node_id=str(node_id_in_console)))
if node_id_in_cplane is None and node_id_in_console is not None:
PAYLOAD.update(dict(node_id=node_id_in_console))
log.info("Registering storage controller in cplane")
node_id_in_cplane = register(LOCAL_CPLANE_URL, LOCAL_CPLANE_JWT_TOKEN, PAYLOAD)
log.info(
Expand Down

0 comments on commit 1f31c6d

Please sign in to comment.