[Bug 1339842] Re: GlanceMirror item filters are hardcoded

Adam Stokes adam.stokes at canonical.com
Wed Jul 16 15:44:18 UTC 2014


** Description changed:

+ [Impact]
  The GlanceMirror class has a hard-coded filter for items to be
  downloaded.
  
  Anyone using it directly or via the script in
  tools/sstream-mirror-glance to load images into an openstack cloud
  will end up with a large number of images, at least one for each of
  the available release series, and only x86_64 or amd64.
  
  It is likely that users will want to be able to limit the images they
  download to just one release, and may want to be able to download
  images for other architectures, such as arm*.
  
  The attached diff simply exposes the existing filter mechanism as a
  config option, using the previous hardcoded values as defaults.
  
  This config option is used (currently it is just ignored by the
  published simplestreams code) in an charm that is released on the
  charm store for trusty, 'glance-simplestreams-sync'. Users of
  OpenStack on Trusty are likely to want the option to control image
  downloads via that charm.
  
  [Test Case]
  
  In an openstack cloud, with proper openstack env vars (OS_USERNAME,
  OS_PASSWORD, OS_REGION etc), run the sstream-mirror-glance tool to
  download images locally:
  
  from the source tree top directory,
  
  PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
  images/ --cloud-name test_cloud --content-id test_content \
  --keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
  http://cloud-images.ubuntu.com/releases/ streams/v1/index.json
  
  verify that it downloads many images. This may take a while.  If you
  like, you can just check that it will download an image for an old
  series like raring or quantal.
  
  Clean up after it by removing the images/ directory.
  
  Then with the update applied, from the source tree top dir:
  
  PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
  images/ --cloud-name test_cloud --content-id test_content \
  --keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
  --item-filter="release=trusty" --item-filter="arch=arm64" \
  http://cloud-images.ubuntu.com/releases/ streams/v1/index.json
  
  and verify that it downloads only one matching image, trusty on arm64.
  
  [Regression Potential]
  
  This has very limited regression potential, because anyone relying on
  the existing behavior will still get it because the previous behavior
  is retained via defaults.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1339842

Title:
  GlanceMirror item filters are hardcoded

Status in Simple Streams client and library:
  Fix Committed
Status in “simplestreams” package in Ubuntu:
  Confirmed

Bug description:
  [Impact]
  The GlanceMirror class has a hard-coded filter for items to be
  downloaded.

  Anyone using it directly or via the script in
  tools/sstream-mirror-glance to load images into an openstack cloud
  will end up with a large number of images, at least one for each of
  the available release series, and only x86_64 or amd64.

  It is likely that users will want to be able to limit the images they
  download to just one release, and may want to be able to download
  images for other architectures, such as arm*.

  The attached diff simply exposes the existing filter mechanism as a
  config option, using the previous hardcoded values as defaults.

  This config option is used (currently it is just ignored by the
  published simplestreams code) in an charm that is released on the
  charm store for trusty, 'glance-simplestreams-sync'. Users of
  OpenStack on Trusty are likely to want the option to control image
  downloads via that charm.

  [Test Case]

  In an openstack cloud, with proper openstack env vars (OS_USERNAME,
  OS_PASSWORD, OS_REGION etc), run the sstream-mirror-glance tool to
  download images locally:

  from the source tree top directory,

  PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
  images/ --cloud-name test_cloud --content-id test_content \
  --keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
  http://cloud-images.ubuntu.com/releases/ streams/v1/index.json

  verify that it downloads many images. This may take a while.  If you
  like, you can just check that it will download an image for an old
  series like raring or quantal.

  Clean up after it by removing the images/ directory.

  Then with the update applied, from the source tree top dir:

  PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
  images/ --cloud-name test_cloud --content-id test_content \
  --keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
  --item-filter="release=trusty" --item-filter="arch=arm64" \
  http://cloud-images.ubuntu.com/releases/ streams/v1/index.json

  and verify that it downloads only one matching image, trusty on arm64.

  [Regression Potential]

  This has very limited regression potential, because anyone relying on
  the existing behavior will still get it because the previous behavior
  is retained via defaults.

To manage notifications about this bug go to:
https://bugs.launchpad.net/simplestreams/+bug/1339842/+subscriptions



More information about the Ubuntu-sponsors mailing list