pygate / pygate-gRPC

A Python gRPC Powergate client
http://pygate.tech
MIT License
22 stars 5 forks source link

ffs.default_config does not return all Config attributes #30

Closed peterVG closed 4 years ago

peterVG commented 4 years ago

See https://github.com/pygate/pygate-gRPC/blob/main/pygate_grpc/ffs.py#L73-L75

If you run the examples script which uses this function (see https://github.com/pygate/pygate-gRPC/blob/main/examples/ffs_config.py), it outputs the following attributes for the Config:

Screen Shot 2020-08-02 at 8 02 58 PM

However, if you use the same FFS and token and run it in CLI you get:

Screen Shot 2020-08-02 at 8 04 30 PM

Specifically the following fields are missing from the pygate ffs.default_config:

from "Hot":

from "Cold":

Also, "Pinned CIDs"

Also of note is that the Powergate CLI output used PascalCase wherease the Pygate output uses snake_case, is this for PEP 8 compliance?

leofisG commented 4 years ago

I think the fields are missing because it's using default value. Specifically: false (for boolean), null (for object), 0 (for number).

leofisG commented 4 years ago

Also of note is that the Powergate CLI output used PascalCase wherease the Pygate output uses snake_case, is this for PEP 8 compliance?

I think it's because the generated code is language-specific, the CLI is written in Go, so it's using Pascal case (public field in Go has to start with a capital letter) while we are using Python.

leofisG commented 4 years ago

You can test this by setting the default configuration, for example set the repairable to be true and it should appear.

peterVG commented 4 years ago

Yes, I've tested and confirmed this. If the "missing" attributes are assigned values and pushed to a new defaultConfig they will display.