From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: automation: check-patch: make pylint on each patch
......................................................................
automation: check-patch: make pylint on each patch
I'm not sure that this long test should be run on each and every patch,
but let us consider this.
Change-Id: Ib4f2f2ec78439ef560b305436160c3140b68e9f2
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M automation/check-patch.sh
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/69346/1
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
index a866771..a401053 100755
--- a/automation/check-patch.sh
+++ b/automation/check-patch.sh
@@ -15,6 +15,7 @@
debuginfo-install -y python
TIMEOUT=600 make check NOSE_WITH_COVERAGE=1 NOSE_COVER_PACKAGE="$PWD/vdsm,$PWD/lib"
+make pylint
# Generate coverage report in HTML format
pushd tests
--
To view, visit https://gerrit.ovirt.org/69346
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4f2f2ec78439ef560b305436160c3140b68e9f2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Yeela Kaplan has uploaded a new change for review.
Change subject: [WIP]configurators: move configurator functions into conf_utils
......................................................................
[WIP]configurators: move configurator functions into conf_utils
Change-Id: Id67a0f51adb2d543c0542a48c020d34a13d1f2ed
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/tool/Makefile.am
A lib/vdsm/tool/conf_utils.py
M vdsm.spec.in
3 files changed, 110 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/44286/1
diff --git a/lib/vdsm/tool/Makefile.am b/lib/vdsm/tool/Makefile.am
index c8979ca..c3ed0cc 100644
--- a/lib/vdsm/tool/Makefile.am
+++ b/lib/vdsm/tool/Makefile.am
@@ -35,7 +35,8 @@
dump_bonding_defaults.py \
dump_volume_chains.py \
nwfilter.py \
- configfile.py \
+ conf_utils.py \
+ configfile.py \
configurator.py \
register.py \
restore_nets.py \
diff --git a/lib/vdsm/tool/conf_utils.py b/lib/vdsm/tool/conf_utils.py
new file mode 100644
index 0000000..1308097
--- /dev/null
+++ b/lib/vdsm/tool/conf_utils.py
@@ -0,0 +1,107 @@
+# Copyright 2015 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+import os
+
+from .. configfile import (
+ ConfigFile,
+)
+
+from ... import utils
+
+if utils.isOvirtNode():
+ from ovirt.node.utils.fs import Config as NodeCfg
+
+
+def get_file(fname, files):
+ return files[fname]['path']
+
+
+def remove_conf(files, version):
+ for cfile, content in files.items():
+ content['removeConf'](content['path'], version)
+
+
+def add_section(content, version, vdsmConfiguration={}):
+ """
+ Add a 'configuration section by vdsm' part to a config file.
+ This section contains only keys not originally defined
+ The section headers will include the current configuration version.
+ """
+ configuration = {}
+ for fragment in content['fragments']:
+ if vdsmConfiguration:
+ if is_applicable(fragment, vdsmConfiguration):
+ configuration.update(fragment['content'])
+ else:
+ configuration.update(fragment['content'])
+ if configuration:
+ with open_config(content['path'], version) as conff:
+ for key, val in configuration.items():
+ conff.addEntry(key, val)
+
+
+def remove_section(path, version):
+ """
+ remove entire 'configuration section by vdsm' section.
+ section is removed regardless of it's version.
+ """
+ if os.path.exists(path):
+ with open_config(path, version) as conff:
+ conff.removeConf()
+
+
+def remove_file(content, vdsmConfiguration):
+ """
+ delete a file if it exists.
+ """
+ if utils.isOvirtNode():
+ NodeCfg().delete(content['path'])
+ else:
+ try:
+ os.unlink(content['path'])
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+
+
+def get_persisted_files(files):
+ """
+ get files where vdsm is expected to add a section.
+ """
+ return [
+ cfile['path'] for cfile in files.values()
+ if cfile['persisted']
+ ]
+
+
+def open_config(path, conf_version):
+ return ConfigFile(path, conf_version)
+
+
+def is_applicable(fragment, vdsmConfiguration):
+ """
+ Return true if 'fragment' should be included for current
+ configuration. An applicable fragment is a fragment who's list
+ of conditions are met according to vdsmConfiguration.
+ """
+ applyFragment = True
+ for key, booleanValue in fragment['conditions'].items():
+ if vdsmConfiguration[key] != booleanValue:
+ applyFragment = False
+ return applyFragment
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 5020d8b..21e1b50 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1094,6 +1094,7 @@
%{python_sitelib}/%{vdsm_name}/tool/dummybr.py*
%{python_sitelib}/%{vdsm_name}/tool/dump_bonding_defaults.py*
%{python_sitelib}/%{vdsm_name}/tool/nwfilter.py*
+%{python_sitelib}/%{vdsm_name}/tool/conf_utils.py*
%{python_sitelib}/%{vdsm_name}/tool/configurator.py*
%{python_sitelib}/%{vdsm_name}/tool/configurators/__init__*
%{python_sitelib}/%{vdsm_name}/tool/configurators/certificates.py*
--
To view, visit https://gerrit.ovirt.org/44286
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id67a0f51adb2d543c0542a48c020d34a13d1f2ed
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
Piotr Kliczewski has uploaded a new change for review.
Change subject: yml: return type fixes for StoragePool.getInfo
......................................................................
yml: return type fixes for StoragePool.getInfo
Signed-off-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Change-Id: Ifeadf2323d2a3535a5777d0cc16027cfb9e42f0e
---
M lib/api/vdsm-api.yml
M tests/vdsmapi_test.py
2 files changed, 72 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/59707/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 7dd95d1..2c139ea 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -5607,6 +5607,21 @@
7: The Storage Domain uses glusterfs
8: The Storage Domain uses cinder
+ StorageType: &StorageType
+ added: '3.1'
+ description: An enumeration of Storage Domain types.
+ name: StorageType
+ type: enum
+ values:
+ CIFS: The Storage Domain uses CIFS/SMB based storage
+ FCP: The Storage Domain uses FibreChannel based storage
+ ISCSI: The Storage Domain uses iSCSI based storage
+ LOCALFS: The Storage Domain uses storage on the local file system
+ NFS: The Storage Domain uses Network File System based storage
+ SHAREDFS: The Storage Domain uses storage from a Linux VFS file
+ system
+ UNKNOWN: The type is not known
+
StorageDomainInfo: &StorageDomainInfo
added: '3.1'
description: Information about a Storage Domain.
@@ -5666,6 +5681,18 @@
unattached: The domain is not attached to a Storage Pool
unknown: The status of the Storage Domain is not known
+ StorageStatus: &StorageStatus
+ added: '3.1'
+ description: An enumeration of Storage Domain statuses.
+ name: StorageDomainStatus
+ type: enum
+ values:
+ Active: The domain is attached to a Storage Pool and is activated
+ Attached: The domain is attached to a Storage Pool but is
+ deactivated
+ Unattached: The domain is not attached to a Storage Pool
+ Unknown: The status of the Storage Domain is not known
+
StorageDomainStatusMap: &StorageDomainStatusMap
added: '3.1'
description: A mapping of Storage Domain statuses indexed by Storage
@@ -5698,7 +5725,8 @@
properties:
- description: The remaining free disk space in bytes
name: diskfree
- type: int
+ type: string
+ datatype: int
- description: A list of alerts for this Storage Domain
name: alerts
@@ -5708,15 +5736,21 @@
- description: The total amount of disk space in the Storage
Domain in bytes
name: disktotal
- type: int
+ type: string
+ datatype: int
- description: Current Storage Domain status
name: status
- type: *StorageDomainStatus
+ type: *StorageStatus
- description: Indicates the Storage Domain version
name: version
type: int
+
+ - description: The filesystem path from where ISO images may
+ be referenced
+ name: isoprefix
+ type: string
type: object
StoragePoolDomainInfoMap: &StoragePoolDomainInfoMap
@@ -5749,15 +5783,16 @@
- description: The Storage Pool lock version
name: lver
- type: int
+ type: long
- description: The Storage Pool version
name: version
- type: int
+ type: string
+ datatype: int
- description: The type of storage managed by this Storage Pool
- name: domainType
- type: *StorageDomainType
+ name: type
+ type: *StorageType
- description: The Storage Pool name
name: name
diff --git a/tests/vdsmapi_test.py b/tests/vdsmapi_test.py
index eddb735..1f319b1 100644
--- a/tests/vdsmapi_test.py
+++ b/tests/vdsmapi_test.py
@@ -607,3 +607,33 @@
_schema.schema().verify_retval(
vdsmapi.MethodRep('StoragePool', 'getSpmStatus'), ret)
+
+ def test_info_storage(self):
+ ret = {'info':
+ {'name': 'No Description',
+ 'isoprefix': '',
+ 'pool_status': 'connected',
+ 'lver': 10,
+ 'domains': u'0900c0cd-8422-497a-85c5-1bb34b2b6b65:Active,794d',
+ 'master_uuid': '3d4accf7-74af-4ea0-b59b-eb9f10eedb83',
+ 'version': '3',
+ 'spm_id': 1,
+ 'type': 'ISCSI',
+ 'master_ver': 33},
+ 'dominfo': {u'0900c0cd-8422-497a-85c5-1bb34b2b6b65':
+ {'status': u'Active',
+ 'diskfree': '48855252992',
+ 'isoprefix': '',
+ 'alerts': [],
+ 'disktotal': '53284438016',
+ 'version': 3},
+ u'794dc113-315f-43e3-ae47-0b7b1bf56427':
+ {'status': u'Active',
+ 'diskfree': '48855252992',
+ 'isoprefix': '',
+ 'alerts': [],
+ 'disktotal': '53284438016',
+ 'version': 3}}}
+
+ _schema.schema().verify_retval(
+ vdsmapi.MethodRep('StoragePool', 'getInfo'), ret)
--
To view, visit https://gerrit.ovirt.org/59707
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifeadf2323d2a3535a5777d0cc16027cfb9e42f0e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Piotr Kliczewski has uploaded a new change for review.
Change subject: yml: parameter type fixes for StoragePool.connect
......................................................................
yml: parameter type fixes for StoragePool.connect
Change-Id: I19b6f25c17e697702ec61eba6b11f256c1df4d83
Signed-off-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/api/vdsm-api.yml
M tests/vdsmapi_test.py
2 files changed, 18 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/59702/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 5eb091c..6cb6c9a 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -5599,11 +5599,11 @@
name: StorageDomainStatus
type: enum
values:
- Active: The domain is attached to a Storage Pool and is activated
- Attached: The domain is attached to a Storage Pool but is
+ active: The domain is attached to a Storage Pool and is activated
+ attached: The domain is attached to a Storage Pool but is
deactivated
- Unattached: The domain is not attached to a Storage Pool
- Unknown: The status of the Storage Domain is not known
+ unattached: The domain is not attached to a Storage Pool
+ unknown: The status of the Storage Domain is not known
StorageDomainStatusMap: &StorageDomainStatusMap
added: '3.1'
diff --git a/tests/vdsmapi_test.py b/tests/vdsmapi_test.py
index 38f5449..fac3bf4 100644
--- a/tests/vdsmapi_test.py
+++ b/tests/vdsmapi_test.py
@@ -502,3 +502,17 @@
_schema.schema().verify_args(
vdsmapi.MethodRep('StoragePool', 'connectStorageServer'),
params)
+
+ def test_sp_connect(self):
+ params = {u'masterVersion': 33,
+ u'domainDict':
+ {u'0900c0cd-8422-497a-85c5-1bb34b2b6b65': u'active',
+ u'794dc113-315f-43e3-ae47-0b7b1bf56427': u'active',
+ u'1d8235ee-c2ce-4c06-abd5-63b655fd66c5': u'active'},
+ u'storagepoolID': u'636d9c59-f7ba-4115-87a1-44d6563a9610',
+ u'scsiKey': u'636d9c59-f7ba-4115-87a1-44d6563a9610',
+ u'masterSdUUID': u'3d4accf7-74af-4ea0-b59b-eb9f10eedb83',
+ u'hostID': 1}
+
+ _schema.schema().verify_args(
+ vdsmapi.MethodRep('StoragePool', 'connect'), params)
--
To view, visit https://gerrit.ovirt.org/59702
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I19b6f25c17e697702ec61eba6b11f256c1df4d83
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>