From 11bca7a4f07c2e7037c8b08b2383a7c6e296b15a Mon Sep 17 00:00:00 2001 From: Michael Gundlach Date: Tue, 16 Nov 2010 13:32:16 -0500 Subject: Add docstrings to any methods I touch --- nova/compute/disk.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- cgit