Skip to content

Commit

Permalink
Always install mdadm (fixes #194)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-ucsc committed Jun 29, 2016
1 parent affc23a commit 58688eb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/src/cgcloud/core/cloud_init_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
from paramiko import Channel

from cgcloud.core.box import Box, fabric_task
from cgcloud.core.package_manager_box import PackageManagerBox
from cgcloud.lib.ec2 import ec2_instance_types
from cgcloud.lib.util import heredoc

log = logging.getLogger( __name__ )


class CloudInitBox( Box ):
class CloudInitBox( PackageManagerBox ):
"""
A box that uses Canonical's cloud-init to initialize the EC2 instance.
"""
Expand Down Expand Up @@ -164,7 +165,7 @@ def _cloudinit_boot_script( self, name ):
@fabric_task
def __add_per_boot_script( self ):
"""
Ensure that the cloud-init.done file is always created, even on 2nd boot and there-after.
Ensure that the cloud-init.done file is always created, even on 2nd boot and thereafter.
On the first boot of an instance, the .done file creation is preformed by the runcmd
stanza in cloud-config. On subsequent boots this per-boot script takes over (runcmd is
skipped on those boots).
Expand Down Expand Up @@ -239,3 +240,11 @@ def stream( name, recv_ready, recv, logger ):
assert 0 == chan.recv_exit_status( )
finally:
client.close( )

def _list_packages_to_install( self ):
# To speed up `recreate` but also to avoid problems caused by a stale package index
# during `recreate`, we should install mdadm unconditionally.
# https://github.com/BD2KGenomics/cgcloud/issues/194
return super( CloudInitBox, self )._list_packages_to_install( ) + [
'mdadm' ]

0 comments on commit 58688eb

Please sign in to comment.