+ def needs_reimage(self, target_slicefamily):
+ stampname = "/vservers/{}/etc/slicefamily".format(self.name)
+ try:
+ with open(stampname) as f:
+ current_slicefamily = f.read().strip()
+ if current_slicefamily != target_slicefamily:
+ logger.info("slice {} : new slice family - would require reimaging"
+ .format(self.name))
+ return True
+ else:
+ return False
+ except IOError as e:
+ logger.verbose("Missing slicefamily {} - considered OK"
+ .format(self.name))
+ return False