diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-11-16 13:32:16 -0500 |
|---|---|---|
| committer | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-11-16 13:32:16 -0500 |
| commit | 11bca7a4f07c2e7037c8b08b2383a7c6e296b15a (patch) | |
| tree | 8275352122f8ff0fcdaf4a25566c256832b32859 | |
| parent | 777663e9673310880e0aaf47093ceedd153eedeb (diff) | |
Add docstrings to any methods I touch
| -rw-r--r-- | nova/compute/disk.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/compute/disk.py b/nova/compute/disk.py index 925c20eee..61c9c077f 100644 --- a/nova/compute/disk.py +++ b/nova/compute/disk.py @@ -165,6 +165,11 @@ def inject_data(image, key=None, net=None, partition=None, execute=None): @defer.inlineCallbacks def _inject_key_into_fs(key, fs, execute=None): + """Add the given public ssh key to root's authorized_keys. + + key is an ssh key string. + fs is the path to the base of the filesystem into which to inject the key. + """ sshdir = os.path.join(os.path.join(fs, 'root'), '.ssh') yield execute('sudo mkdir -p %s' % sshdir) # existing dir doesn't matter yield execute('sudo chown root %s' % sshdir) @@ -175,6 +180,10 @@ def _inject_key_into_fs(key, fs, execute=None): @defer.inlineCallbacks def _inject_net_into_fs(net, fs, execute=None): + """Inject /etc/network/interfaces into the filesystem rooted at fs. + + net is the contents of /etc/network/interfaces. + """ netdir = os.path.join(os.path.join(fs, 'etc'), 'network') yield execute('sudo mkdir -p %s' % netdir) # existing dir doesn't matter yield execute('sudo chown root:root %s' % netdir) |
