This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 987157 - [RFE] please add ability to rename systems using csv
[RFE] please add ability to rename systems using csv
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.15.3
: ---
Assigned To: Amit Saha
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2013-07-22 16:32 EDT by andrew
Modified: 2015-07-26 18:15 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-02-02 23:52:00 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description andrew 2013-07-22 16:32:58 EDT
Description of problem:
[RFE] please add ability to rename systems using csv.

Right now if a list of systems needs to renamed or moved to a new network csv can not be used to rename them.

Version-Release number of selected component (if applicable):

How reproducible:100%

Steps to Reproduce:
1. Download system list
2. Rename list of set systems
3. Upload

Actual results:
CSV upload just adds renamed systems as new systems and leaves old ones in place

Expected results:
Have old systems renamed to new names.

Additional info:
Comment 2 Dan Callaghan 2013-07-22 19:48:16 EDT
Currently there's no way to rename systems because the CSV importer uses the 'fqdn' column to identify the system to update. If we changed it to include the Beaker database id and use that to identify each row instead, we could do it.
Comment 3 Nick Coghlan 2013-07-23 00:41:35 EDT
I guess that could work, since the desired workflow is export -> modify -> import.

So if we include the ID column in the export, then this will transparently do the right thing on the import.

However, are there other use cases that could break? What if you *want* to add new systems rather than modifying existing ones?

I like the idea in principle, I just think we need to be cautious about not breaking existing workflows for people that are used to the current behaviour.

A more user friendly approach might be to have *two* FQDN columns in the export. One for "FQDN" and another for "Updated FQDN" (which would obviously be the same on export)
Comment 4 Dan Callaghan 2013-12-10 22:39:34 EST
I think an id column would work. The import code would need to handle the case where the id column is absent or empty and treat that row the way it does presently (look up by fqdn).

Having an "fqdn" and a "new_fqdn" column would work too although I think it makes things more cluttered and more confusing, particularly in the case were you don't actually want to rename anything (the majority of the time, I think).

An alternative would be a new bkr command for modifying systems, which also allows renaming:

    bkr system-modify --fqdn=newfqdn oldfqdn

which could be scripted using bash. But for bulk modification of FQDNs that's actually less convenient than just sed'ing a CSV file.
Comment 5 Nick Coghlan 2013-12-10 22:44:01 EST
OK, I'm persuaded that an optional id column is the way to go. If it's missing entirely or empty for a particular row, then we do the lookup by FQDN (adding systems as needed). If it is present, then we interpret that as referring to a previously exported system, and update the FQDN in the database to match the one in the CSV.
Comment 6 Nick Coghlan 2013-12-12 02:08:26 EST
We'll also aim to get this into a 0.15 maintenance release, rather than waiting for 0.16.
Comment 7 Amit Saha 2013-12-16 01:08:26 EST
Comment 8 Amit Saha 2014-01-07 00:12:25 EST
The documentation describing this feature is tracked in a separate patch:
Comment 10 Amit Saha 2014-01-09 02:34:13 EST
Suggested verification steps:

1. Export system (for modification) data
2. Modify the FQDN of one or more systems
3. Import the data
4. Check if the FQDNs have been updated.
Comment 12 Nick Coghlan 2014-02-02 23:52:00 EST
This change is included in the Beaker 0.15.3 maintenance release:

Note You need to log in before you can comment on or make changes to this bug.