Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
71e4d0b32a | |||
f16bad4691 | |||
15d92c483f | |||
7dd17e71e7 |
@ -42,6 +42,14 @@ To get started with PVC, please see the [About](https://parallelvirtualcluster.r
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
#### v0.9.28
|
||||||
|
|
||||||
|
* [CLI Client] Revamp confirmation options for "vm modify" command
|
||||||
|
|
||||||
|
#### v0.9.27
|
||||||
|
|
||||||
|
* [CLI Client] Fixes a bug with vm modify command when passed a file
|
||||||
|
|
||||||
#### v0.9.26
|
#### v0.9.26
|
||||||
|
|
||||||
* [Node Daemon] Corrects some bad assumptions about fencing results during hardware failures
|
* [Node Daemon] Corrects some bad assumptions about fencing results during hardware failures
|
||||||
|
@ -25,7 +25,7 @@ import yaml
|
|||||||
from distutils.util import strtobool as dustrtobool
|
from distutils.util import strtobool as dustrtobool
|
||||||
|
|
||||||
# Daemon version
|
# Daemon version
|
||||||
version = '0.9.26'
|
version = '0.9.28'
|
||||||
|
|
||||||
# API version
|
# API version
|
||||||
API_VERSION = 1.0
|
API_VERSION = 1.0
|
||||||
|
@ -764,9 +764,19 @@ def vm_meta(domain, node_limit, node_selector, node_autostart, migration_method,
|
|||||||
help='Immediately restart VM to apply new config.'
|
help='Immediately restart VM to apply new config.'
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
'-y', '--yes', 'confirm_flag',
|
'-d', '--confirm-diff', 'confirm_diff_flag',
|
||||||
is_flag=True, default=False,
|
is_flag=True, default=False,
|
||||||
help='Confirm the restart'
|
help='Confirm the diff.'
|
||||||
|
)
|
||||||
|
@click.option(
|
||||||
|
'-c', '--confirm-restart', 'confirm_restart_flag',
|
||||||
|
is_flag=True, default=False,
|
||||||
|
help='Confirm the restart.'
|
||||||
|
)
|
||||||
|
@click.option(
|
||||||
|
'-y', '--yes', 'confirm_all_flag',
|
||||||
|
is_flag=True, default=False,
|
||||||
|
help='Confirm the diff and the restart.'
|
||||||
)
|
)
|
||||||
@click.argument(
|
@click.argument(
|
||||||
'domain'
|
'domain'
|
||||||
@ -774,7 +784,7 @@ def vm_meta(domain, node_limit, node_selector, node_autostart, migration_method,
|
|||||||
@click.argument(
|
@click.argument(
|
||||||
'cfgfile', type=click.File(), default=None, required=False
|
'cfgfile', type=click.File(), default=None, required=False
|
||||||
)
|
)
|
||||||
def vm_modify(domain, cfgfile, editor, restart, confirm_flag):
|
def vm_modify(domain, cfgfile, editor, restart, confirm_diff_flag, confirm_restart_flag, confirm_all_flag):
|
||||||
"""
|
"""
|
||||||
Modify existing virtual machine DOMAIN, either in-editor or with replacement CONFIG. DOMAIN may be a UUID or name.
|
Modify existing virtual machine DOMAIN, either in-editor or with replacement CONFIG. DOMAIN may be a UUID or name.
|
||||||
"""
|
"""
|
||||||
@ -788,12 +798,12 @@ def vm_modify(domain, cfgfile, editor, restart, confirm_flag):
|
|||||||
|
|
||||||
dom_name = vm_information.get('name')
|
dom_name = vm_information.get('name')
|
||||||
|
|
||||||
if editor is True:
|
# Grab the current config
|
||||||
# Grab the current config
|
current_vm_cfg_raw = vm_information.get('xml')
|
||||||
current_vm_cfg_raw = vm_information.get('xml')
|
xml_data = etree.fromstring(current_vm_cfg_raw)
|
||||||
xml_data = etree.fromstring(current_vm_cfg_raw)
|
current_vm_cfgfile = etree.tostring(xml_data, pretty_print=True).decode('utf8').strip()
|
||||||
current_vm_cfgfile = etree.tostring(xml_data, pretty_print=True).decode('utf8').strip()
|
|
||||||
|
|
||||||
|
if editor is True:
|
||||||
new_vm_cfgfile = click.edit(text=current_vm_cfgfile, require_save=True, extension='.xml')
|
new_vm_cfgfile = click.edit(text=current_vm_cfgfile, require_save=True, extension='.xml')
|
||||||
if new_vm_cfgfile is None:
|
if new_vm_cfgfile is None:
|
||||||
click.echo('Aborting with no modifications.')
|
click.echo('Aborting with no modifications.')
|
||||||
@ -831,9 +841,10 @@ def vm_modify(domain, cfgfile, editor, restart, confirm_flag):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
cleanup(False, 'Error: XML is malformed or invalid: {}'.format(e))
|
cleanup(False, 'Error: XML is malformed or invalid: {}'.format(e))
|
||||||
|
|
||||||
click.confirm('Write modifications to cluster?', abort=True)
|
if not confirm_diff_flag and not confirm_all_flag and not config['unsafe']:
|
||||||
|
click.confirm('Write modifications to cluster?', abort=True)
|
||||||
|
|
||||||
if restart and not confirm_flag and not config['unsafe']:
|
if restart and not confirm_restart_flag and not confirm_all_flag and not config['unsafe']:
|
||||||
try:
|
try:
|
||||||
click.confirm('Restart VM {}'.format(domain), prompt_suffix='? ', abort=True)
|
click.confirm('Restart VM {}'.format(domain), prompt_suffix='? ', abort=True)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='pvc',
|
name='pvc',
|
||||||
version='0.9.26',
|
version='0.9.28',
|
||||||
packages=['pvc', 'pvc.cli_lib'],
|
packages=['pvc', 'pvc.cli_lib'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'Click',
|
'Click',
|
||||||
|
12
debian/changelog
vendored
12
debian/changelog
vendored
@ -1,3 +1,15 @@
|
|||||||
|
pvc (0.9.28-0) unstable; urgency=high
|
||||||
|
|
||||||
|
* [CLI Client] Revamp confirmation options for "vm modify" command
|
||||||
|
|
||||||
|
-- Joshua M. Boniface <joshua@boniface.me> Mon, 19 Jul 2021 09:29:34 -0400
|
||||||
|
|
||||||
|
pvc (0.9.27-0) unstable; urgency=high
|
||||||
|
|
||||||
|
* [CLI Client] Fixes a bug with vm modify command when passed a file
|
||||||
|
|
||||||
|
-- Joshua M. Boniface <joshua@boniface.me> Mon, 19 Jul 2021 00:03:40 -0400
|
||||||
|
|
||||||
pvc (0.9.26-0) unstable; urgency=high
|
pvc (0.9.26-0) unstable; urgency=high
|
||||||
|
|
||||||
* [Node Daemon] Corrects some bad assumptions about fencing results during hardware failures
|
* [Node Daemon] Corrects some bad assumptions about fencing results during hardware failures
|
||||||
|
@ -42,6 +42,14 @@ To get started with PVC, please see the [About](https://parallelvirtualcluster.r
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
#### v0.9.28
|
||||||
|
|
||||||
|
* [CLI Client] Revamp confirmation options for "vm modify" command
|
||||||
|
|
||||||
|
#### v0.9.27
|
||||||
|
|
||||||
|
* [CLI Client] Fixes a bug with vm modify command when passed a file
|
||||||
|
|
||||||
#### v0.9.26
|
#### v0.9.26
|
||||||
|
|
||||||
* [Node Daemon] Corrects some bad assumptions about fencing results during hardware failures
|
* [Node Daemon] Corrects some bad assumptions about fencing results during hardware failures
|
||||||
|
@ -56,7 +56,7 @@ import pvcnoded.CephInstance as CephInstance
|
|||||||
import pvcnoded.MetadataAPIInstance as MetadataAPIInstance
|
import pvcnoded.MetadataAPIInstance as MetadataAPIInstance
|
||||||
|
|
||||||
# Version string for startup output
|
# Version string for startup output
|
||||||
version = '0.9.26'
|
version = '0.9.28'
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# PVCD - node daemon startup program
|
# PVCD - node daemon startup program
|
||||||
|
Reference in New Issue
Block a user