~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-22 07:02:07 UTC
  • Revision ID: mbp@sourcefrog.net-20050322070207-1bc11ab0bd497d19
fix up uuid command

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
    ## XXX: Could alternatively read /proc/sys/kernel/random/uuid on
87
87
    ## Linux, but we need something portable for other systems;
88
88
    ## preferably an implementation in Python.
89
 
    bailout('uuids not allowed!')
90
 
    return chomp(os.popen('uuidgen').readline())
 
89
    try:
 
90
        return chomp(file('/proc/sys/kernel/random/uuid').readline())
 
91
    except IOError:
 
92
        return chomp(os.popen('uuidgen').readline())
 
93
 
91
94
 
92
95
def chomp(s):
93
96
    if s and (s[-1] == '\n'):