openmainframeproject / feilong

Feilong is a open source z/VM cloud connector project under the Open Mainframe Project umbrella that will accelerate the z/VM adoption, extending its ecosystem and its user experience. It provides a set of APIs to operate z/VM including guest, image, network, volume etc.
https://www.openmainframeproject.org/projects/feilong
Apache License 2.0
35 stars 70 forks source link

Multipath is a boolean, not a string #794

Closed Bischoff closed 7 months ago

Bischoff commented 7 months ago

When one tries to run the example at https://cloudlib4zvm.readthedocs.io/en/latest/restapi.html#attach-volume

i.e.

{
  "info":
  {
      "connection":
      {
        "assigner_id": "username",
        "zvm_fcp": "1fc5",
        "target_wwpn": "0x50050763050b073d",
        "target_lun": "0x4020400100000000",
        "os_version": "redhat7",
        "multipath": True,
        "mount_point": "/dev/sdz",
        "is_root_volume": False
      }
  }
}

the following exception is thrown:

HTTP status: 500, body: {"overallRC": 500, "modID": 100, "rc": 500, "rs": 1, "errmsg":
 "Unexpected internal error in ZVM SDK, error: (127.0.0.1:46170) SDK server got unexpected exception:
 AttributeError(\"'bool' object has no attribute 'lower'\")", "output": ""}

This PR fixes this problem.

jackydalong commented 7 months ago

HI @Bischoff Thank you for fixing the issue. Please fix 'This branch is out-of-date with the base branch', it is blocking code merge

Bischoff commented 7 months ago

Thanks a lot for this big review @jackydalong .

Sorry for the delay in rebasing. You should be able to merge now.

About the boolean type: I have nothing against permitting all kinds of fancy string booleans like "NO" or "OFF". But python's "official" booleans are True and False and they should IMHO at least keep working :smile: .

jackydalong commented 7 months ago

@bjhuangr please help merge