Skip to content

Commit

Permalink
Make system_uuid_alias_add syntax valid for python2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlyak40wt committed Dec 26, 2011
1 parent 1f4697a commit 87e7e81
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cuisine.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,11 @@ def system_uuid_alias_add():
/etc/hosts e.g. 127.0.0.1 localhost <hostname>.
"""
with mode_sudo(), cd('/etc'):
old = "127.0.0.1 localhost"
new = old + " " + system_uuid()
file_update('hosts', lambda x: text_replace_line(x, old, new)[0])
with mode_sudo():
with cd('/etc'):
old = "127.0.0.1 localhost"
new = old + " " + system_uuid()
file_update('hosts', lambda x: text_replace_line(x, old, new)[0])

def system_uuid():
"""Gets a machines UUID (Universally Unique Identifier)."""
Expand Down

0 comments on commit 87e7e81

Please sign in to comment.