~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/openstack/common/imageutils.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-03-30 11:14:57 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20150330111457-kr4ju3guf22m4vbz
Tags: 2015.1~b3-0ubuntu1
* New upstream release.
  + d/control: 
    - Align with upstream dependencies.
    - Add dh-python to build-dependencies.
    - Add psmisc as a dependency. (LP: #1358820)
  + d/p/fix-requirements.patch: Rediffed.
  + d/ironic-conductor.init.in: Fixed typos in LSB headers,
    thanks to JJ Asghar. (LP: #1429962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import re
23
23
 
24
 
from ironic.openstack.common.gettextutils import _
25
 
from ironic.openstack.common import strutils
 
24
from oslo_utils import strutils
 
25
 
 
26
from ironic.openstack.common._i18n import _
26
27
 
27
28
 
28
29
class QemuImgInfo(object):
100
101
            real_details = real_details.strip().lower()
101
102
        elif root_cmd == 'snapshot_list':
102
103
            # Next line should be a header, starting with 'ID'
103
 
            if not lines_after or not lines_after[0].startswith("ID"):
 
104
            if not lines_after or not lines_after.pop(0).startswith("ID"):
104
105
                msg = _("Snapshot list encountered but no header found!")
105
106
                raise ValueError(msg)
106
 
            del lines_after[0]
107
107
            real_details = []
108
108
            # This is the sprintf pattern we will try to match
109
109
            # "%-10s%-20s%7s%20s%15s"
118
118
                date_pieces = line_pieces[5].split(":")
119
119
                if len(date_pieces) != 3:
120
120
                    break
 
121
                lines_after.pop(0)
121
122
                real_details.append({
122
123
                    'id': line_pieces[0],
123
124
                    'tag': line_pieces[1],
125
126
                    'date': line_pieces[3],
126
127
                    'vm_clock': line_pieces[4] + " " + line_pieces[5],
127
128
                })
128
 
                del lines_after[0]
129
129
        return real_details
130
130
 
131
131
    def _parse(self, cmd_output):