diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-09 22:35:14 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-09 22:35:14 +0000 |
| commit | 4f95a9781b5bf872ded3a507d941fa70a84a8a6d (patch) | |
| tree | 0426242e6fafbb813c76d0f2539de9c6e9e05397 /plugins | |
| parent | c963e9d73affad98c52c5c81c45a8256b6ae7f3f (diff) | |
| parent | e507094eef9a7b4a54a04faade8aa95a36fa6d93 (diff) | |
Merge "Enable live block migration when using iSCSI volumes"
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec | 1 | ||||
| -rwxr-xr-x | plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec b/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec index 66c13967e..b93c7b071 100644 --- a/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec +++ b/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec @@ -31,6 +31,7 @@ rm -rf $RPM_BUILD_ROOT /etc/xapi.d/plugins/agent /etc/xapi.d/plugins/bandwidth /etc/xapi.d/plugins/bittorrent +/etc/xapi.d/plugins/config_file /etc/xapi.d/plugins/glance /etc/xapi.d/plugins/kernel /etc/xapi.d/plugins/migration diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file b/plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file new file mode 100755 index 000000000..417c477b4 --- /dev/null +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import XenAPIPlugin + + +def get_val(session, args): + config_key = args['key'] + config_file = open('/etc/xapi.conf') + try: + for line in config_file: + split = line.split('=') + if (len(split) == 2) and (split[0].strip() == config_key): + return split[1].strip() + return "" + finally: + config_file.close() + +if __name__ == '__main__': + XenAPIPlugin.dispatch({"get_val": get_val}) |
