Skip to content

Commit f3b93e6

Browse files
committed
Remove prepare from proxmox and hyperv. Builtin exts disabled by default.
1 parent eb21fc8 commit f3b93e6

File tree

3 files changed

+2
-43
lines changed

3 files changed

+2
-43
lines changed

engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ BEGIN
308308
)
309309
VALUES (
310310
UUID(), ext_name, ext_desc, 'Orchestrator',
311-
entry_point, 1, 0, 'Enabled', NOW(), NULL
311+
entry_point, 1, 0, 'Disabled', NOW(), NULL
312312
)
313313
; END IF
314314
;END;

extensions/HyperV/hyperv.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,6 @@ def run_powershell_ssh(command, url, username, password):
5757
fail(str(e))
5858

5959

60-
def generate_random_mac():
61-
hexchars = "0123456789ABCDEF"
62-
return "52:54:00:{:02X}:{:02X}:{:02X}".format(
63-
random.randint(0, 255),
64-
random.randint(0, 255),
65-
random.randint(0, 255)
66-
)
67-
68-
69-
def prepare(data):
70-
mac_address = generate_random_mac()
71-
response = {
72-
"status": "success",
73-
"mac_address": mac_address,
74-
"message": "Instance prepared"
75-
}
76-
print(json.dumps(response))
77-
78-
7960
def create(data):
8061
vm_name = data["virtualmachinename"]
8162
cpus = data["cpus"]
@@ -267,7 +248,6 @@ def main():
267248
fail("Invalid JSON in file")
268249

269250
operations = {
270-
"prepare": prepare,
271251
"create": create,
272252
"start": start,
273253
"stop": stop,

extensions/Proxmox/proxmox.sh

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818

19-
generate_random_mac() {
20-
hexchars="0123456789ABCDEF"
21-
echo "52:54:00:$(for i in {1..3}; do echo -n ${hexchars:$(( RANDOM % 16 )):1}${hexchars:$(( RANDOM % 16 )):1}; [[ $i -lt 3 ]] && echo -n ':'; done)"
22-
}
23-
2419
urlencode() {
2520
encoded_data=$(python3 -c "import urllib.parse; print(urllib.parse.quote('''$1'''))")
2621
echo "$encoded_data"
@@ -110,7 +105,7 @@ call_proxmox_api() {
110105
local path=$2
111106
local data=$3
112107

113-
echo "curl -sk --fail -X $method -H \"Authorization: PVEAPIToken=${user}!${token}=${secret}\" ${data:+-d \"$data\"} https://${url}:8006/api2/json${path}" >&2
108+
#echo "curl -sk --fail -X $method -H \"Authorization: PVEAPIToken=${user}!${token}=${secret}\" ${data:+-d \"$data\"} https://${url}:8006/api2/json${path}" >&2
114109
response=$(curl -sk --fail -X "$method" \
115110
-H "Authorization: PVEAPIToken=${user}!${token}=${secret}" \
116111
${data:+-d "$data"} \
@@ -179,19 +174,6 @@ execute_and_wait() {
179174
wait_for_proxmox_task "$upid"
180175
}
181176

182-
prepare() {
183-
parse_json "$1" || exit 1
184-
185-
local mac_address
186-
mac_address=$(generate_random_mac)
187-
188-
local response
189-
response=$(jq -n --arg mac "$mac_address" \
190-
'{status: "success", mac_address: $mac}')
191-
192-
echo "$response"
193-
}
194-
195177
create() {
196178
parse_json "$1" || exit 1
197179

@@ -324,9 +306,6 @@ fi
324306
parameters=$(<"$parameters_file")
325307

326308
case $action in
327-
prepare)
328-
prepare "$parameters"
329-
;;
330309
create)
331310
create "$parameters"
332311
;;

0 commit comments

Comments
 (0)