libzfs-python icon indicating copy to clipboard operation
libzfs-python copied to clipboard

NVList.update() method

Open avg-I opened this issue 11 years ago • 3 comments

It seems that NVList.update() method is unusable now, because internally it calls NVList.add() with 2 parameters, but actual NVList.add() requires 3 parameters. It is not clear whether it would be possible to infer proper data types from python types at all. So, is this unfinished work-in-progress code or is this dead code? Or am I missing something?

avg-I avatar Mar 18 '15 13:03 avg-I

I am currently in the process of rewriting a lot of things (check the 'rewrite' branch for what i'm actively working on)... I will look into it as I'm starting to head towards re-implementing libnvpair as I got this notification.

xaroth avatar Mar 18 '15 13:03 xaroth

7bd6472dea6338 reimplemented NVList mostly (though it's untested until I can rework zpool a bit more).. mind that it no longer features a NVList.update() , as it's much easier to just do:

[NVList.add(key, data_type, value) for key, data_type_value in listing]

The old NVList.update functionality pretty much did the same anyhow.. and there's no proper way to detect which data type you want to use.. maybe at some point in the future we can make a guessing system for the data types so this becomes more easily available.

xaroth avatar Mar 18 '15 16:03 xaroth

Thanks!

avg-I avatar Mar 18 '15 16:03 avg-I