emc-openstack / storops

Python storage management library for VNX and Unity.
Apache License 2.0
53 stars 29 forks source link

"cannot parse list: a list converter must be specified" #337

Closed dkmonaghan closed 2 years ago

dkmonaghan commented 3 years ago

Hello,

We are receiving the following output:

cannot parse list: [{'currentTransferSize': 0, 'currentTransferRemain': 0, 'dstStatus': 0, 'name': 'sv_27=>sv_27', 'networkStatus': 0, 'currentWriteRate': 0, 'dstLunInstanceId': 'root/emc:EMC_UEM_ReplicationRemoteSystemLeaf%InstanceID=RS_1%Name=XXXXXX%SystemName=VNXe*root/emc:EMC_UEM_StorageVolumeLeaf%InstanceID=sv_27', 'currentTransferEstRemainTime': 0, 'srcLunId': 'sv_27', 'currentTransferRate': 0, 'srcLunInstanceId': 'root/emc:EMC_UEM_StorageVolumeLeaf%InstanceID=sv_27', 'currentReadRate': 0, 'srcStatus': 3, 'dstLunId': 'sv_27', 'maxTimeOutOfSync': 0}, {'currentTransferSize': 0, 'currentTransferRemain': 0, 'dstStatus': 0, 'name': 'sv_25=>sv_25', 'networkStatus': 0, 'currentWriteRate': 0, 'dstLunInstanceId': 'root/emc:EMC_UEM_ReplicationRemoteSystemLeaf%InstanceID=RS_1%Name=XXXXXX%SystemName=VNXe*root/emc:EMC_UEM_StorageVolumeLeaf%InstanceID=sv_25', 'currentTransferEstRemainTime': 0, 'srcLunId': 'sv_25', 'currentTransferRate': 0, 'srcLunInstanceId': 'root/emc:EMC_UEM_StorageVolumeLeaf%InstanceID=sv_25', 'currentReadRate': 0, 'srcStatus': 3, 'dstLunId': 'sv_25', 'maxTimeOutOfSync': 0}, {'currentTransferSize': 0, 'currentTransferRemain': 0, 'dstStatus': 0, 'name': 'sv_26=>sv_26', 'networkStatus': 0, 'currentWriteRate': 0, 'dstLunInstanceId': 'root/emc:EMC_UEM_ReplicationRemoteSystemLeaf%InstanceID=RS_1%Name=XXXXXX%SystemName=VNXe*root/emc:EMC_UEM_StorageVolumeLeaf%InstanceID=sv_26', 'currentTransferEstRemainTime': 0, 'srcLunId': 'sv_26', 'currentTransferRate': 0, 'srcLunInstanceId': 'root/emc:EMC_UEM_StorageVolumeLeaf%InstanceID=sv_26', 'currentReadRate': 0, 'srcStatus': 3, 'dstLunId': 'sv_26', 'maxTimeOutOfSync': 0}].  a list converter must be specified.

When running the following code against our Unity 400 appliances:

# Loop through replication sessions
filters={
    'local_role': storops.ReplicationSessionReplicationRoleEnum.SOURCE,
    'status': storops.ReplicationOpStatusEnum.PAUSED
}
for session in unity.get_replication_session(**filters):

    # As we're resuming NAS servers, we don't need to resume any filesystems - they get done automatically
    if session.replication_resource_type == storops.ReplicationEndpointResourceTypeEnum.FILESYSTEM:
        continue

    session.resume()

This code just loops through all replication sessions and runs session.resume(). The code works as expected, resuming all sessions, but the above output gets sent to stdout. Is there any way to fix / suppress this output?

yong-huang commented 3 years ago

Hi,

I cannot reproduce this issue in my test environment (Unity 500, 5.1.0), this is my test script:

import storops

# storops.enable_log()

unity = storops.UnitySystem('xxx', 'xxx', 'xxx')

filters = {
    'local_role': storops.ReplicationSessionReplicationRoleEnum.SOURCE,
    # 'status': storops.ReplicationOpStatusEnum.AUTO_SYNC_CONFIGURED,
    'status': storops.ReplicationOpStatusEnum.PAUSED,
}

for session in unity.get_replication_session(**filters):
    # if session.replication_resource_type == storops.ReplicationEndpointResourceTypeEnum.FILESYSTEM:
    if not session.replication_resource_type == storops.ReplicationEndpointResourceTypeEnum.NASSERVER:
        continue

    # print(session)
    session.resume()

The script executed successfully. No "cannot parse list" error as you mentioned. What's the software version of your Unity? Maybe it is a Unity issue or compatibility issue of a specific Unity version and the latest storops?

dkmonaghan commented 3 years ago

Hi @yong-huang,

I've used this code of ours again this evening and have the same issue with "cannot parse list". The code executes as expected and does resume all the sessions, but the error output still displays.

Here is some more information:

yong-huang commented 2 years ago

Fixed in https://github.com/emc-openstack/storops/pull/363.