-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a way to change both the vm name and hostname #16
base: master
Are you sure you want to change the base?
Conversation
@@ -306,6 +306,22 @@ def vm_disk(vmid, disk, size): | |||
return '', 403 | |||
|
|||
|
|||
@app.route("/starrs/<string:vmid>/hostname/<string:old_name>/<string:new_name>", methods=['POST']) | |||
@auth.oidc_auth | |||
def vm_disk(vmid, old_name, new_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably shouldn't be named vm_disk
if valid and available: | ||
vm = VM(vmid) | ||
vm.rename_vm(new_name) | ||
change_hostname(starrs, old_name, new_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a function to rename the name of the system in STARRS? Proxstar tracks systems by their system name, so changing everything but that will cause it to no longer be able to match up a STARRS record with a VM.
}) | ||
.then((new_name) => { | ||
if (new_name) { | ||
fetch(`/starrs/${vmid}/hostname/${old_name}/${new_name}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to do something like /vm/${vmid}/rename
and include the new name in the POST data
credentials: 'same-origin', | ||
method: 'post' | ||
}).then((response) => { | ||
return swal(`VM Name has been changes!`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lowercase name
and changed
} | ||
}).catch(err => { | ||
if (err) { | ||
swal("Uh oh...", `Unable to change VM Name. Please try again later.`, "error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lowercase name
@frybin Any progress on this? I think this would be a cool feature to see |
@devinmatte I plan to do this during the summer when I have some more time to work on things. |
No description provided.