Improve cta-admin consistency with empty string
Summary
As shown in https://gitlab.cern.ch/cta/operations/-/issues/1613, some cta-admin
commands print empty strings as "-"
.
Instead, it should never prefill empty strings as something different.
Steps to reproduce
cta-admin --json tape ls --vid I71007 | jq .[].encryptionKeyName
"-"
cta-admin --json tape ls --vid L85844 | jq .[].encryptionKeyName
"-"
What is the current bug behaviour?
cta-admin
should never change stings for json.
What is the expected correct behaviour?
cta-admin
should never change stings for json.
Relevant logs and/or screenshots
Possible causes
This seems to originate is specific parts of the code.
SSI CTA Frontend:
./xroot_plugins/XrdCtaTapeLs.hpp
tape_item->set_encryption_key_name((bool)tape.encryptionKeyName ? tape.encryptionKeyName.value() : "-");
gRPC CTA Frontend:
./frontend/grpc/ServerTapeLsRequestHandler.cpp
157 pTapeLsItem->set_encryption_key_name((bool)tape.encryptionKeyName ?
168 pTapeLsItem->set_purchase_order((bool)tape.purchaseOrder ? tape.purchaseOrder.value() : "-");
Other parts of the code:
./common/dataStructures/MountType.cpp
54 case MountType::NoMount:
55 return "-";
./common/dataStructures/QueueAndMountSummary.cpp
40 summaryList.back().vid="-";
41 summaryList.back().logicalLibrary="-";