Skip to content

Commit

Permalink
Some last bits of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oldpatricka committed Aug 27, 2012
1 parent 1266811 commit 4c0591b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
Expand Up @@ -698,7 +698,7 @@ def test_restart_mode_abnormal(self):

eeagent.fail_process("proc2")

self.notifier.wait_for_state("proc2", ProcessState.PENDING)
self.notifier.wait_for_state("proc2", ProcessState.PENDING, 10)
self.notifier.wait_for_state("proc2", ProcessState.RUNNING)
self._wait_assert_pd_dump(self._assert_process_states,
ProcessState.RUNNING, ["proc2"])
Expand Down
3 changes: 3 additions & 0 deletions epu/provisioner/leader.py
Expand Up @@ -175,6 +175,9 @@ def run_terminator(self):

pool.join()

with self.condition:
self.condition.wait(1)


def kill_terminator(self):
"""He'll be back"""
Expand Down
5 changes: 0 additions & 5 deletions epu/provisioner/store.py
Expand Up @@ -492,7 +492,6 @@ def _run_election(self):
"""
self._election_thread_running = True
while self._election_thread_running:
print "election"
with self._election_condition:
try:
self.election.run(self._leader.inaugurate)
Expand Down Expand Up @@ -723,10 +722,6 @@ def get_children():
return children

children = get_children()
# TODO: PDA: ask david if this is okay
#while not children:
# time.sleep(1)
# children = get_children()

records = []
for node_id in children:
Expand Down
3 changes: 2 additions & 1 deletion epu/provisioner/test/test_provisioner_service_integration.py
Expand Up @@ -65,7 +65,8 @@ def setup(self):

epu_path = os.path.dirname(epu.__file__)
self.dt_data = os.path.join(epu_path, "test", "filedts")
_, self.fake_libcloud_db = tempfile.mkstemp()
fh, self.fake_libcloud_db = tempfile.mkstemp()
os.close(fh)

deployment = fake_libcloud_deployment % default_user
self.epuharness = EPUHarness(exchange=self.exchange)
Expand Down
3 changes: 2 additions & 1 deletion epu/test/test_integration_creds.py
Expand Up @@ -25,7 +25,8 @@

def make_fake_libcloud_site(site_name):
from epu.mocklibcloud import MockEC2NodeDriver
_, fake_libcloud_db = tempfile.mkstemp()
fh, fake_libcloud_db = tempfile.mkstemp()
os.close(fh)

fake_site = {
'name': site_name,
Expand Down
3 changes: 2 additions & 1 deletion epu/test/test_integration_domain.py
Expand Up @@ -29,7 +29,8 @@

def make_fake_libcloud_site():
from epu.mocklibcloud import MockEC2NodeDriver
_, fake_libcloud_db = tempfile.mkstemp()
fh, fake_libcloud_db = tempfile.mkstemp()
os.close(fh)

site_name = str(uuid.uuid4())
fake_site = {
Expand Down
3 changes: 2 additions & 1 deletion epu/test/test_integration_site.py
Expand Up @@ -25,7 +25,8 @@

def make_fake_libcloud_site(site_name):
from epu.mocklibcloud import MockEC2NodeDriver
_, fake_libcloud_db = tempfile.mkstemp()
fh, fake_libcloud_db = tempfile.mkstemp()
os.close(fh)

fake_site = {
'name': site_name,
Expand Down
3 changes: 2 additions & 1 deletion epu/test/test_mocklibcloud.py
Expand Up @@ -15,7 +15,8 @@ def setup(self):
raise SkipTest("SQLAlchemy not available.")

from epu.mocklibcloud import MockEC2NodeDriver
_, self.sqlite_db_file = tempfile.mkstemp()
fh, self.sqlite_db_file = tempfile.mkstemp()
os.close(fh)
self.libcloud = MockEC2NodeDriver(sqlite_db=self.sqlite_db_file)

def test_start(self):
Expand Down
3 changes: 2 additions & 1 deletion epu/test/test_phantom_integration.py
Expand Up @@ -93,7 +93,8 @@ def setup(self):
raise SkipTest("EPUHarness running. Can't run this test")

# Set up fake libcloud and start deployment
_, self.fake_libcloud_db = tempfile.mkstemp()
fh, self.fake_libcloud_db = tempfile.mkstemp()
os.close(fh)
fake_site['driver_kwargs']['sqlite_db'] = self.fake_libcloud_db
self.epuharness = EPUHarness(exchange=self.exchange)
self.dashi = self.epuharness.dashi
Expand Down
3 changes: 2 additions & 1 deletion epu/vagrantprovisioner/test/test_vagrant.py
Expand Up @@ -68,7 +68,8 @@ def test_chef(self):
"recipes":["user"]
}
""" % user
(_, chef_json_file) = tempfile.mkstemp()
(fh, chef_json_file) = tempfile.mkstemp()
os.close(fh)
with open(chef_json_file, "w") as chef_json_fh:
chef_json_fh.write(chef_json)

Expand Down

0 comments on commit 4c0591b

Please sign in to comment.