Add an option to replicator to select which images to compare/copy

Bug #1411215 reported by Arthur Lutz (Logilab) on 2015-01-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Wishlist
Unassigned

Bug Description

It would be nice to add some sort of filter to images considered by glance-replicator.

Two types of a filters would be nice :

* a list of ids
* a list of names

(and maybe some sort of regexp on the names, for example --filter "ubuntu-*")

A quick look at the code makes me think this can easily be added in the def get_images just before the yield.

For interfacing I would add :

 --filter-by-name 'item1,item2,item3"
 --filter-by-name 'ubuntu-*'
 --filter-by-id 'id1,id2,id3'

Am willing to contribute a patch if feature request is adopted (we are going to implement it anyway).

Ian Cordasco (icordasc) on 2015-01-17
Changed in glance:
importance: Undecided → Wishlist
status: New → Incomplete
Ian Cordasco (icordasc) wrote :

I marked this as "Wishlist" because it's an enhancement request and Incomplete because we haven't yet decided whether to accept it.

Personally, it seems feasible to support --filter-by-id and --filter-by-name's first case. Personally I'm not a fan of your `--filter-by-name 'ubuntu-*'` example because I can't think of another openstack cli that supports anything like that. I also don't like the idea of supporting arbitrary regular expressions provided by users. I'm going to add this to the meeting agenda for next Thursday's meeting though to discuss it.

Thanks for suggesting it!

No problem about not going for the regexp, I understand why you are reluctant.

One could easily script using bash to answer that scenario (for i in `glance image-list | grep ubuntu-`; etc.)

Marc Abramowitz (msabramo) wrote :

I was thinking of implementing something to allow only syncing images that match a regex. For my use case, I want to make sure that images that start with "Koala" are synced. So something like --filter-by-regex=Koala.* would be handy.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers