Skip to content

Commit

Permalink
Merge pull request #28 from trisha-dell/Victory_support
Browse files Browse the repository at this point in the history
Adding support for PowerStore 4.0.0.0
  • Loading branch information
Jennifer-John authored Apr 23, 2024
2 parents 4c7bb63 + a948fdf commit bd47038
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 14 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# PyPowerStore Change Log

## Version 3.2.0.0 - released on 30/04/24
- Added support for PowerStore 4.0.0.0 version(Victory release).

## Version 3.1.0.0 - released on 29/02/24
- Added support for session management using cookie.

Expand Down
2 changes: 1 addition & 1 deletion PyPowerStore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""__init__.py."""

__title__ = 'PyPowerStore'
__version__ = '3.1.0.0'
__version__ = '3.2.0.0'
__author__ = 'Dell Technologies or its subsidiaries'
__copyright__ = 'Copyright 2024 Dell Technologies'
10 changes: 7 additions & 3 deletions PyPowerStore/provisioning.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dell Technologies
# Copyright: (c) 2024, Dell Technologies

"""Collection of provisioning related functions for PowerStore"""

Expand Down Expand Up @@ -642,7 +642,9 @@ def get_volume_details(self, volume_id):
"""
LOG.info("Getting volume details by ID: '%s'" % volume_id)
querystring = constants.SELECT_ALL_VOLUME
if helpers.is_foot_hill_prime_or_higher():
if helpers.is_victory_or_higher():
querystring = constants.VICTORY_VOLUME_DETAILS_QUERY
elif helpers.is_foot_hill_prime_or_higher():
querystring = constants.FHP_VOLUME_DETAILS_QUERY
elif helpers.is_foot_hill_or_higher():
querystring = constants.FHC_VOLUME_DETAILS_QUERY
Expand All @@ -668,7 +670,9 @@ def get_volume_by_name(self, volume_name):
"""
LOG.info("Getting volume details by name: '%s'" % volume_name)
querystring = constants.SELECT_ALL_VOLUME
if helpers.is_foot_hill_prime_or_higher():
if helpers.is_victory_or_higher():
querystring = constants.VICTORY_VOLUME_DETAILS_QUERY
elif helpers.is_foot_hill_prime_or_higher():
querystring = constants.FHP_VOLUME_DETAILS_QUERY
elif helpers.is_foot_hill_or_higher():
querystring = constants.FHC_VOLUME_DETAILS_QUERY
Expand Down
16 changes: 15 additions & 1 deletion PyPowerStore/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
# max number of items limit in a response
MAX_LIMIT = 2000

# Foot Hill Prime Plus Version
# Platform Versions
FOOTHILL_VERSION = '2.0.0.0'
MALKA_VERSION = '2.1.0.0'
FOOTHILL_PRIME_VERSION = '3.0.0.0'
FOOTHILL_PRIME_PLUS_VERSION = '3.2.0.0'
VICTORY_VERSION = '4.0.0.0'

# Query params

Expand Down Expand Up @@ -64,6 +68,16 @@
"migration_session_id"
}

VICTORY_VOLUME_DETAILS_QUERY = {
"select": "id,name,description,type,wwn,nsid,nguid,appliance_id,state,"
"size,logical_used,node_affinity,creation_timestamp,"
"protection_policy_id,performance_policy_id,qos_performance_policy_id,"
"is_replication_destination,migration_session_id,metro_replication_session_id,"
"is_host_access_available,protection_data,location_history,"
"app_type,app_type_other,type_l10n,state_l10n,node_affinity_l10n,app_type_l10n,"
"volume_groups(name,id), protection_policy(name,id)"
}

# Host Query
SELECT_ALL_HOST = {
"select": "id,name,description,os_type,"
Expand Down
24 changes: 17 additions & 7 deletions PyPowerStore/utils/helpers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dell Technologies
# Copyright: (c) 2024, Dell Technologies

"""Helper module for PowerStore"""
import logging
from pkg_resources import parse_version
from PyPowerStore.utils import constants

provisioning_obj = None

Expand Down Expand Up @@ -52,10 +53,9 @@ def is_foot_hill_or_higher():
:return: True if foot hill or higher
:rtype: bool
"""
foot_hill_version = '2.0.0.0'
array_version = provisioning_obj.get_array_version()
if array_version and (
parse_version(array_version[0:7]) >= parse_version(foot_hill_version)):
parse_version(array_version[0:7]) >= parse_version(constants.FOOTHILL_VERSION)):
return True
return False

Expand All @@ -65,10 +65,9 @@ def is_malka_or_higher():
:return: True if array version is Malka or higher
:rtype: bool
"""
malka_version = '2.1.0.0'
array_version = provisioning_obj.get_array_version()
if array_version and (
parse_version(array_version[0:7]) >= parse_version(malka_version)):
parse_version(array_version[0:7]) >= parse_version(constants.MALKA_VERSION)):
return True
return False

Expand All @@ -78,10 +77,21 @@ def is_foot_hill_prime_or_higher():
:return: True if foothill prime or higher
:rtype: bool
"""
foot_hill_prime_version = '3.0.0.0'
array_version = provisioning_obj.get_array_version()
if array_version and (
parse_version(array_version[0:7]) >= parse_version(foot_hill_prime_version)):
parse_version(array_version[0:7]) >= parse_version(constants.FOOTHILL_PRIME_VERSION)):
return True
return False

def is_victory_or_higher():
"""Returns true if the array version is victory or higher.
:return: True if victory or higher
:rtype: bool
"""
array_version = provisioning_obj.get_array_version()
if array_version and (
parse_version(array_version[0:7]) >= parse_version(constants.VICTORY_VERSION)):
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = 'Dell'

# The full version, including alpha/beta/rc tags
release = '3.1.0.0'
release = '3.2.0.0'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


setup(name='PyPowerStore',
version='3.1.0.0',
version='3.2.0.0',
description='Python Library for Dell PowerStore',
author='Ansible Team at Dell',
author_email='ansible.team@dell.com',
Expand Down

0 comments on commit bd47038

Please sign in to comment.