devel/py-os-brick: add NFS support
- Add initial NFS support through third party patches - Bump PORTREVISION PR: 215156 Submitted by: maintainer
This commit is contained in:
parent
d7be09043a
commit
5412aebebc
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=428334
4 changed files with 90 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
PORTNAME= os-brick
|
||||
PORTVERSION= 1.8.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= devel python
|
||||
MASTER_SITES= CHEESESHOP
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
@ -30,6 +31,9 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}os-win>=0.2.3:devel/py-os-win \
|
|||
|
||||
NO_ARCH= yes
|
||||
|
||||
EXTRA_PATCHES= ${FILESDIR}/01-os-type.patch:-p1 \
|
||||
${FILESDIR}/02-nfs.patch:-p1
|
||||
|
||||
USES= python
|
||||
USE_PYTHON= autoplist distutils
|
||||
|
||||
|
|
47
devel/py-os-brick/files/01-os-type.patch
Normal file
47
devel/py-os-brick/files/01-os-type.patch
Normal file
|
@ -0,0 +1,47 @@
|
|||
From b2edffa81edb25202ec6ed08d131b8fa4153a1d5 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
|
||||
Date: Thu, 8 Dec 2016 16:26:21 +0300
|
||||
Subject: [PATCH] add support for freebsd os
|
||||
|
||||
---
|
||||
os_brick/initiator/__init__.py | 1 +
|
||||
os_brick/initiator/connector.py | 4 ++++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/os_brick/initiator/__init__.py b/os_brick/initiator/__init__.py
|
||||
index 95e0b10..aa91615 100644
|
||||
--- a/os_brick/initiator/__init__.py
|
||||
+++ b/os_brick/initiator/__init__.py
|
||||
@@ -34,6 +34,7 @@ PLATFORM_S390 = 'S390'
|
||||
OS_TYPE_ALL = 'ALL'
|
||||
OS_TYPE_LINUX = 'LINUX'
|
||||
OS_TYPE_WINDOWS = 'WIN'
|
||||
+OS_TYPE_FREEBSD = 'FREEBSD'
|
||||
|
||||
S390X = "s390x"
|
||||
S390 = "s390"
|
||||
diff --git a/os_brick/initiator/connector.py b/os_brick/initiator/connector.py
|
||||
index 86adfa8..989b8d6 100644
|
||||
--- a/os_brick/initiator/connector.py
|
||||
+++ b/os_brick/initiator/connector.py
|
||||
@@ -51,6 +51,7 @@ PLATFORM_S390 = 'S390'
|
||||
OS_TYPE_ALL = 'ALL'
|
||||
OS_TYPE_LINUX = 'LINUX'
|
||||
OS_TYPE_WINDOWS = 'WIN'
|
||||
+OS_TYPE_FREEBSD = 'FREEBSD'
|
||||
|
||||
S390X = "s390x"
|
||||
S390 = "s390"
|
||||
@@ -204,6 +205,9 @@ def get_connector_properties(root_helper, my_ip, multipath, enforce_multipath,
|
||||
props['ip'] = my_ip
|
||||
props['host'] = host if host else socket.gethostname()
|
||||
|
||||
+ if sys.platform.startswith('freebsd'):
|
||||
+ props['os_type'] = OS_TYPE_FREEBSD
|
||||
+
|
||||
for item in connector_list:
|
||||
connector = importutils.import_class(item)
|
||||
|
||||
--
|
||||
2.8.1
|
||||
|
35
devel/py-os-brick/files/02-nfs.patch
Normal file
35
devel/py-os-brick/files/02-nfs.patch
Normal file
|
@ -0,0 +1,35 @@
|
|||
From fe3bf36779f577ef737108eb1d30b46a75fa4748 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
|
||||
Date: Thu, 8 Dec 2016 16:27:57 +0300
|
||||
Subject: [PATCH] initial NFS support
|
||||
|
||||
---
|
||||
os_brick/initiator/connectors/remotefs.py | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/os_brick/initiator/connectors/remotefs.py b/os_brick/initiator/connectors/remotefs.py
|
||||
index 50f11c1..f22b652 100644
|
||||
--- a/os_brick/initiator/connectors/remotefs.py
|
||||
+++ b/os_brick/initiator/connectors/remotefs.py
|
||||
@@ -26,6 +26,8 @@ LOG = logging.getLogger(__name__)
|
||||
class RemoteFsConnector(base.BaseLinuxConnector):
|
||||
"""Connector class to attach/detach NFS and GlusterFS volumes."""
|
||||
|
||||
+ os_type = initiator.OS_TYPE_FREEBSD
|
||||
+
|
||||
def __init__(self, mount_type, root_helper, driver=None,
|
||||
execute=None,
|
||||
device_scan_attempts=initiator.DEVICE_SCAN_ATTEMPTS_DEFAULT,
|
||||
@@ -35,8 +37,7 @@ class RemoteFsConnector(base.BaseLinuxConnector):
|
||||
mount_type_lower = mount_type.lower()
|
||||
if conn:
|
||||
mount_point_base = conn.get('mount_point_base')
|
||||
- if mount_type_lower in ('nfs', 'glusterfs', 'scality',
|
||||
- 'quobyte', 'vzstorage'):
|
||||
+ if mount_type_lower in ('nfs',):
|
||||
kwargs[mount_type_lower + '_mount_point_base'] = (
|
||||
kwargs.get(mount_type_lower + '_mount_point_base') or
|
||||
mount_point_base)
|
||||
--
|
||||
2.8.1
|
||||
|
|
@ -1,2 +1,5 @@
|
|||
Please note that this is a development version.
|
||||
Mounting cinder volumes doesn't work.
|
||||
Only initial NFS support was added.
|
||||
|
||||
Enable NFS client in rc.conf
|
||||
# sysrc nfs_client_enable="YES"
|
||||
|
|
Loading…
Reference in a new issue