mirror of
https://opendev.org/x/pyghmi
synced 2025-02-19 12:04:49 +00:00
Update the unusable stripsize
The stripsize was formally unusably difficult and incorrectly named. Fix both problems. Change-Id: I05da211b6a629cea29b3760731c67d699824ba83
This commit is contained in:
parent
0fac38cdf3
commit
3b8a8b93c3
@ -19,6 +19,7 @@ from datetime import datetime
|
||||
import errno
|
||||
import fnmatch
|
||||
import json
|
||||
import math
|
||||
import os.path
|
||||
import pyghmi.constants as pygconst
|
||||
import pyghmi.exceptions as pygexc
|
||||
@ -1101,8 +1102,10 @@ class XCCClient(IMMClient):
|
||||
nameappend += 1
|
||||
else:
|
||||
name = vol.name
|
||||
stripesize = props['stripsize'] if vol.stripesize is None \
|
||||
else vol.stripesize
|
||||
if vol.stripsize:
|
||||
stripsize = int(math.log(vol.stripsize * 2, 2))
|
||||
else:
|
||||
stripsize = props['stripsize']
|
||||
strsize = 'remainder' if vol.size is None else str(vol.size)
|
||||
if strsize in ('all', '100%'):
|
||||
volsize = params['capacity']
|
||||
@ -1122,7 +1125,7 @@ class XCCClient(IMMClient):
|
||||
raise pygexc.InvalidParameterValue(
|
||||
'Requested sizes exceed available capacity')
|
||||
vols.append('{0};{1};{2};{3};{4};{5};{6};{7};{8};|'.format(
|
||||
name, volsize, stripesize, props['cpwb'], props['cpra'],
|
||||
name, volsize, stripsize, props['cpwb'], props['cpra'],
|
||||
props['cpio'], props['ap'], props['dcp'], props['initstate']))
|
||||
url = '/api/function'
|
||||
arglist = '{0},{1},{2},{3},{4},{5},'.format(
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
class Disk(object):
|
||||
def __init__(self, name, description=None, id=None, status=None,
|
||||
serial=None, fru=None, stripesize=None):
|
||||
serial=None, fru=None, stripsize=None):
|
||||
"""
|
||||
|
||||
:param name: A name descripbing the disk in human readable terms
|
||||
@ -33,7 +33,7 @@ class Disk(object):
|
||||
self.status = status
|
||||
self.serial = serial
|
||||
self.fru = fru
|
||||
self.stripesize = stripesize
|
||||
self.stripsize = stripsize
|
||||
|
||||
|
||||
class Array(object):
|
||||
@ -63,14 +63,14 @@ class Array(object):
|
||||
|
||||
class Volume(object):
|
||||
def __init__(self, name=None, size=None, status=None, id=None,
|
||||
stripesize=None):
|
||||
stripsize=None):
|
||||
"""
|
||||
|
||||
:param name: Name of the volume
|
||||
:param size: Size of the volume in MB
|
||||
:param status: Controller indicated status of the volume
|
||||
:param id: Controller idintefier of a given volume
|
||||
:param stripesize: The stripesize of the volume
|
||||
:param stripsize: The stripsize of the volume in kibibytes
|
||||
"""
|
||||
self.name = name
|
||||
if isinstance(size, int):
|
||||
@ -87,7 +87,7 @@ class Volume(object):
|
||||
self.size = size
|
||||
self.status = status
|
||||
self.id = id
|
||||
self.stripesize = stripesize
|
||||
self.stripsize = stripsize
|
||||
|
||||
|
||||
class ConfigSpec(object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user