Skip to content

Commit

Permalink
fix the code for scp openapi change
Browse files Browse the repository at this point in the history
fix the code for scp openapi change
  • Loading branch information
hyoxt121 authored Aug 12, 2024
1 parent 1c32aa4 commit a59cfc6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sky/skylet/providers/scp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,21 @@ def get_vcp_subnets(self):

def _get_vm_init_script(self, ssh_public_key):

import subprocess
init_script_content = self._get_default_config_cmd(
) + self._get_ssh_key_gen_cmd(ssh_public_key)
init_script_content_string = f'"{init_script_content}"'
command = f'echo {init_script_content_string} | base64'
result = subprocess.run(command,
shell=True,
capture_output=True,
text=True)
init_script_content_base64 = result.stdout
return {
"encodingType": "plain",
"encodingType": "base64",
"initialScriptShell": "bash",
"initialScriptType": "text",
"initialScriptContent": init_script_content
"initialScriptContent": init_script_content_base64
}

def _get_ssh_key_gen_cmd(self, ssh_public_key):
Expand Down

0 comments on commit a59cfc6

Please sign in to comment.