content-hosts non-itemized export/import missing subscription parity w/ --itemized-subscriptions
|Assigned To:||Thomas McKay|
|Velocity based estimate||-|
The all-in-one subscription export/import default mode is not capable of the same features as the itemized method. Specifically, all the columns used for --itemized-subscriptions need to be represented in the all-in-one data in order to handle hypervisor and guest subscriptions properly. Once the fields are all represented then the code can be refactored to a single implementation.
#2 Updated by Thomas McKay 8 months ago
At present in non-itemized mode (the default) I have tried to compress the important values into a csv-parseable field: "$quantity|$sku|$name|$contract|$account". If this is to continue, all of the itemized columns should be represented separated by pipe (|). This would let that field be parsed and passed to the same code as the itemized csv rows.
Additionally, if the Subscriptions column is blank, all of the subscriptions are removed on the host. There is no no-op mode. I would suggest that if the column is empty then it would be a no-op. If the column value is "Remove All" (or something similar), then the existing subscriptions attached to the host should be removed. Maybe instead, though, a command option could be added to "clear before attach". This pattern is good for resetting a group of hosts to an explicit set of subscriptions. Remember that the itemized import only adds to the subscriptions, it does not remove any. It would be useful in the itemized mode to also have a "clear before attach" such that the first time a host is encountered in the CSV existing subs would be bulk removed.