Public bug reported:
The GlanceMirror class has no callback to provide progress updates on
image downloads. OS images are often large enough (and you may be
syncing several images) that this presents a serious UX problem during
which a user (or client program) of simplestreams will not be able to
tell that anything is happening.

The attached diff exposes progress update callbacks with a minimum of
changes to existing program logic. The GlanceMirror class gets a basic
callback, and calling code is expected to handle figuring out what
images will be downloaded and their size before calling
GlanceMirror.sync(). In order to help with this, a separate class
"ItemInfoDryRunMirror" is added, to make use of the same filter logic
that GlanceMirror will use but instead just collect a list of images
to download and their size.

Since this is provided as optional keyword arguments, existing users
will not be affected.

[Test Case]

>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

And verify that it prints status updates to stdout. The
sstream-mirror-glance tool has been updated to use the new api in
GlanceMirror.

[Regression Potential]

This has limited regression potential, because the new functionality
is provided as optional arguments. If anything is running the
sstream-mirror-glance script and parsing its output, that may break,
but that seems very unlikely because that script does not currently
produce anything useful to parse.

** Affects: simplestreams
     Importance: Undecided
         Status: New

** Affects: simplestreams (Ubuntu)
     Importance: Undecided
         Status: New

** Also affects: simplestreams (Ubuntu)
   Importance: Undecided
       Status: New

** Branch linked: lp:~mikemc/simplestreams/glance-extra-progress

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to simplestreams in Ubuntu.
https://bugs.launchpad.net/bugs/1340983

Title:
  GlanceMirror class does not expose progress update callbacks

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to