summaryrefslogtreecommitdiffstats
path: root/state.rb
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-11-07 15:16:31 -0500
committerCasey Dahlin <cdahlin@redhat.com>2008-11-07 15:16:31 -0500
commit174313860aa680c063b7fd2783fe6a7b637d64d4 (patch)
treeeaa37352a7aaa1adfba6cbca763c9c79c27f468d /state.rb
parent2c628ecf2332b6d2a6df59e215b3777d2fddbc35 (diff)
downloadupstate-174313860aa680c063b7fd2783fe6a7b637d64d4.tar.gz
upstate-174313860aa680c063b7fd2783fe6a7b637d64d4.tar.xz
upstate-174313860aa680c063b7fd2783fe6a7b637d64d4.zip
Add check for forking a live state.
States which are up should never fork.
Diffstat (limited to 'state.rb')
-rw-r--r--state.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/state.rb b/state.rb
index cf54f75..b8e2964 100644
--- a/state.rb
+++ b/state.rb
@@ -133,6 +133,7 @@ class State
# Duplicate this class and bring the duplicate up with the given hold attached
def fork(hold)
+ raise Consistency Fault, "Fork of live state" unless @status == :down
new_one = self.clone
new_one.instance_eval do
@holds = Set.new [hold]