~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/Core/utils.py

  • Committer: Michael Terry
  • Date: 2012-05-15 19:43:43 UTC
  • mto: This revision was merged to the branch mainline in revision 2428.
  • Revision ID: michael.terry@canonical.com-20120515194343-tocvo0awttmggie1
update several strings to match the software updater spec; most notably, rename from Update Manager to Software Updater

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
  p.stdout.close()
210
210
  return dist
211
211
 
 
212
def get_dist_description():
 
213
  " return the description of the current runing distro "
 
214
  # support debug overwrite
 
215
  desc = os.environ.get("META_RELEASE_FAKE_DESCRIPTION")
 
216
  if desc:
 
217
      logging.warn("using fake release description '%s' (because of META_RELEASE_FAKE_DESCRIPTION environment) " % dist)
 
218
      return desc
 
219
  # then check the real one
 
220
  from subprocess import Popen, PIPE
 
221
  p = Popen(["lsb_release","-d","-s"],stdout=PIPE)
 
222
  res = p.wait()
 
223
  if res != 0:
 
224
    sys.stderr.write("lsb_release returned exitcode: %i\n" % res)
 
225
    return "unknown distribution"
 
226
  desc = p.stdout.readline().strip()
 
227
  p.stdout.close()
 
228
  return desc
 
229
 
212
230
class HeadRequest(Request):
213
231
    def get_method(self):
214
232
        return "HEAD"