Lines 208-214
def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None
|
Link Here
|
---|
|
208 |
|
208 |
|
209 |
dprint('Mounting the ISO image %s' % iso) |
209 |
dprint('Mounting the ISO image %s' % iso) |
210 |
|
210 |
|
211 |
resultCode=os.system('mount -o loop %s %s' % ( iso, cdrom_mount_point)) |
211 |
resultCode = subprocess.call(('mount', '-o', 'loop', iso, cdrom_mount_point)) |
212 |
if resultCode not in (0,32): |
212 |
if resultCode not in (0,32): |
213 |
res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point)) |
213 |
res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point)) |
214 |
if res != 0: |
214 |
if res != 0: |
Lines 218-224
def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None
|
Link Here
|
---|
|
218 |
|
218 |
|
219 |
dprint('Mounting cdrom %s' % cdrom_mount_point) |
219 |
dprint('Mounting cdrom %s' % cdrom_mount_point) |
220 |
|
220 |
|
221 |
resultCode = subprocess.call(['mount', cdrom_mount_point]) |
221 |
resultCode = subprocess.call(['mount', '-o', 'ro', cdrom_mount_point]) |
222 |
if resultCode not in (0,32): |
222 |
if resultCode not in (0,32): |
223 |
res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point)) |
223 |
res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point)) |
224 |
if res != 0: |
224 |
if res != 0: |
Lines 232-238
def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None
|
Link Here
|
---|
|
232 |
nextversion = f.readline().strip('\n').lower().replace('nextupdate=', '') |
232 |
nextversion = f.readline().strip('\n').lower().replace('nextupdate=', '') |
233 |
finally: |
233 |
finally: |
234 |
f.close() |
234 |
f.close() |
235 |
except: |
235 |
except IOError, e: |
236 |
raise UpdateError("%s does not contain an update for version %s-%s."%(device_name,vv,vp), errorsource='PREPARATION') |
236 |
raise UpdateError("%s does not contain an update for version %s-%s."%(device_name,vv,vp), errorsource='PREPARATION') |
237 |
else: |
237 |
else: |
238 |
raise UpdateError("%s is not a valid UCS update medium" % device_name, errorsource='PREPARATION') |
238 |
raise UpdateError("%s is not a valid UCS update medium" % device_name, errorsource='PREPARATION') |
Lines 242-249
def update_available(mode, baseConfig, cdrom_mount_point, iso=None, updater=None
|
Link Here
|
---|
|
242 |
res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point)) |
242 |
res=os.system('mount -l 2>>%s | grep -q " %s "' % (LOGNAME, cdrom_mount_point)) |
243 |
if res == 0: |
243 |
if res == 0: |
244 |
dprint('Warning: Failed to unmount %s' % device_name) |
244 |
dprint('Warning: Failed to unmount %s' % device_name) |
245 |
if nextversion: |
245 |
if nextversion: |
|
|
246 |
try: |
246 |
ver = UCS_Version(nextversion) |
247 |
ver = UCS_Version(nextversion) |
|
|
248 |
except AttributeError, e: |
249 |
pass |
250 |
else: |
247 |
mm_version = UCS_Version.FORMAT % ver |
251 |
mm_version = UCS_Version.FORMAT % ver |
248 |
if not updater: |
252 |
if not updater: |
249 |
updater = LocalUpdater() |
253 |
updater = LocalUpdater() |