Skip to content

Commit ec38279

Browse files
authored
Merge pull request #40 from cloudify-incubator/0.9.5-build
0.9.5-build
2 parents a649267 + bea3bce commit ec38279

File tree

8 files changed

+587
-5
lines changed

8 files changed

+587
-5
lines changed

CHANGELOG.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@
3333
0.9.1.1: Testing webhook for Marketplace scraping
3434
0.9.2: Rerelease for build system.
3535
0.9.3: Rerelease with rhel8.
36-
0.9.4: Add Passthrough Devices support.
36+
0.9.4: Add Passthrough Devices support.
37+
0.9.5: manylinux and dsl 1.5

cloudify_libvirt/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '0.9.4'
1+
version = '0.9.5'

cloudify_libvirt/domain_tasks.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,3 +805,114 @@ def perfomance(**kwargs):
805805
ctx.logger.info("Statistics: {}".format(repr(statistics)))
806806
finally:
807807
conn.close()
808+
809+
810+
@operation
811+
def update_domain_flags(**kwargs):
812+
ctx.logger.info("Update domain")
813+
814+
libvirt_auth, template_params = common.get_libvirt_params(**kwargs)
815+
resource_id = ctx.instance.runtime_properties.get('resource_id')
816+
817+
if not resource_id:
818+
# not uninstall workflow, raise exception
819+
raise cfy_exc.NonRecoverableError("No servers for update")
820+
821+
libvirt_auth, _ = common.get_libvirt_params(**kwargs)
822+
conn = libvirt.open(libvirt_auth)
823+
if conn is None:
824+
raise cfy_exc.NonRecoverableError(
825+
'Failed to open connection to the hypervisor'
826+
)
827+
828+
try:
829+
try:
830+
dom = conn.lookupByName(resource_id)
831+
except libvirt.libvirtError as e:
832+
raise cfy_exc.NonRecoverableError(
833+
'Failed to find the domain: {}'.format(repr(e))
834+
)
835+
836+
state, _ = dom.state()
837+
if state == libvirt.VIR_DOMAIN_RUNNING:
838+
ctx.logger.info("Looks as running. Stop before updating")
839+
return
840+
xmlconfig = common.gen_xml_template(kwargs, template_params, 'domain')
841+
dom.updateDeviceFlags(xmlconfig)
842+
ctx.logger.info('Domain {0} updated.'.format(resource_id))
843+
finally:
844+
conn.close()
845+
846+
847+
@operation
848+
def detach_device_flags(**kwargs):
849+
ctx.logger.info("Update domain")
850+
851+
libvirt_auth, template_params = common.get_libvirt_params(**kwargs)
852+
resource_id = ctx.instance.runtime_properties.get('resource_id')
853+
854+
if not resource_id:
855+
# not uninstall workflow, raise exception
856+
raise cfy_exc.NonRecoverableError("No servers for update")
857+
858+
libvirt_auth, _ = common.get_libvirt_params(**kwargs)
859+
conn = libvirt.open(libvirt_auth)
860+
if conn is None:
861+
raise cfy_exc.NonRecoverableError(
862+
'Failed to open connection to the hypervisor'
863+
)
864+
865+
try:
866+
try:
867+
dom = conn.lookupByName(resource_id)
868+
except libvirt.libvirtError as e:
869+
raise cfy_exc.NonRecoverableError(
870+
'Failed to find the domain: {}'.format(repr(e))
871+
)
872+
873+
state, _ = dom.state()
874+
if state == libvirt.VIR_DOMAIN_RUNNING:
875+
ctx.logger.info("Looks as running. Stop before updating")
876+
return
877+
xmlconfig = common.gen_xml_template(kwargs, template_params, 'domain')
878+
dom.detachDeviceFlags(xmlconfig)
879+
ctx.logger.info('Domain {0} updated.'.format(resource_id))
880+
finally:
881+
conn.close()
882+
883+
884+
@operation
885+
def attach_device_flags(**kwargs):
886+
ctx.logger.info("Update domain")
887+
888+
libvirt_auth, template_params = common.get_libvirt_params(**kwargs)
889+
resource_id = ctx.instance.runtime_properties.get('resource_id')
890+
891+
if not resource_id:
892+
# not uninstall workflow, raise exception
893+
raise cfy_exc.NonRecoverableError("No servers for update")
894+
895+
libvirt_auth, _ = common.get_libvirt_params(**kwargs)
896+
conn = libvirt.open(libvirt_auth)
897+
if conn is None:
898+
raise cfy_exc.NonRecoverableError(
899+
'Failed to open connection to the hypervisor'
900+
)
901+
902+
try:
903+
try:
904+
dom = conn.lookupByName(resource_id)
905+
except libvirt.libvirtError as e:
906+
raise cfy_exc.NonRecoverableError(
907+
'Failed to find the domain: {}'.format(repr(e))
908+
)
909+
910+
state, _ = dom.state()
911+
if state == libvirt.VIR_DOMAIN_RUNNING:
912+
ctx.logger.info("Looks as running. Stop before updating")
913+
return
914+
xmlconfig = common.gen_xml_template(kwargs, template_params, 'domain')
915+
dom.attachDeviceFlags(xmlconfig)
916+
ctx.logger.info('Domain {0} updated.'.format(resource_id))
917+
finally:
918+
conn.close()

extra-packaging-instructions.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if [[ $PY311 == 1 ]]
2+
then
3+
mkdir -p ./pydoc
4+
touch ./pydoc/__init__.py
5+
cat <<EOF > ./pydoc/__init__.py
6+
def get_doc(*args):
7+
return ''
8+
EOF
9+
mkdir -p ./webbrowser
10+
touch ./webbrowser/__init__.py
11+
cat <<EOF > ./webbrowser/__init__.py
12+
EOF
13+
git apply python311.patch
14+
echo patch applied
15+
fi

plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins:
22
libvirt:
33
executor: central_deployment_agent
44
package_name: cloudify-libvirt-plugin
5-
package_version: '0.9.4'
5+
package_version: '0.9.5'
66

77
data_types:
88

plugin_1_4.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins:
22
libvirt:
33
executor: central_deployment_agent
44
package_name: cloudify-libvirt-plugin
5-
package_version: '0.9.4'
5+
package_version: '0.9.5'
66

77
blueprint_labels:
88
obj-type:

0 commit comments

Comments
 (0)