summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/distros/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 3c536f2b..8cffb0ee 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -171,9 +171,11 @@ class Distro(object):
return distros
def set_random_seed(self, seed):
- if self.random_seed_fn:
- # Ensure we only write 512 bytes worth
- util.write_file(self.random_seed_fn, seed[0:512], mode=0600)
+ if not self.random_seed_fn:
+ raise IOError("No random seed filename provided for %s"
+ % (self.name))
+ # Ensure we only write 512 bytes worth
+ util.write_file(self.random_seed_fn, seed[0:512], mode=0600)
def update_hostname(self, hostname, fqdn, prev_hostname_fn):
applying_hostname = hostname