Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frybin
Copy link

@frybin frybin commented Feb 18, 2019

No description provided.

proxstar/starrs.py Outdated Show resolved Hide resolved
proxstar/static/js/script.js Outdated Show resolved Hide resolved
@@ -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):
Copy link
Member

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)
Copy link
Member

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}`, {
Copy link
Member

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!`, {
Copy link
Member

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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowercase name

@devinmatte
Copy link
Member

@frybin Any progress on this? I think this would be a cool feature to see

@frybin
Copy link
Author

frybin commented May 4, 2019

@devinmatte I plan to do this during the summer when I have some more time to work on things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants