~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to virtinst/ImageFetcher.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-02-01 15:40:11 UTC
  • mfrom: (1.3.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20110201154011-op0nusgc240xajvb
Tags: 0.500.5-1ubuntu1
* Merge from debian experimental. Remaining changes:
  - debian/patches/9001_Ubuntu.patch:
     + Updated to add maverick and natty to OS list and enable virtio
       for them.
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch. (refreshed)
  - debian/control: added acl package to depends.
  - Demote virt-viewer to Suggests, as it's in universe.
  - Recommends libvirt-bin
* Removed patches:
  - debian/patches/9002-libvirt_disk_format.patch: Upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        else:
45
45
            path = self.location
46
46
 
47
 
        if not path.endswith("/"):
48
 
            path += "/"
49
 
        path += filename
 
47
        if filename:
 
48
            if not path.endswith("/"):
 
49
                path += "/"
 
50
            path += filename
 
51
 
50
52
        return path
51
53
 
52
54
    def saveTemp(self, fileobj, prefix):
82
84
 
83
85
            try:
84
86
                f = grabber.urlopen(path,
85
 
                                    progress_obj = progresscb,
86
 
                                    text = _("Retrieving file %s...") % base)
 
87
                                    progress_obj=progresscb,
 
88
                                    text=_("Retrieving file %s...") % base)
87
89
            except Exception, e:
88
 
                raise ValueError, _("Couldn't acquire file %s: %s") % \
89
 
                                    (path, str(e))
 
90
                raise ValueError(_("Couldn't acquire file %s: %s") %
 
91
                                   (path, str(e)))
90
92
 
91
93
            tmpname = self.saveTemp(f, prefix=base + ".")
92
94
            logging.debug("Saved file to " + tmpname)
204
206
 
205
207
    def prepareLocation(self):
206
208
        self.srcdir = self.location
207