def task_enable_flocker_control(distribution, action='start'):
 validate_start_action(action)
 if is_systemd_distribution(distribution):
  return sequence([run_from_args(['systemctl', 'enable', 'flocker-control']), run_from_args(['systemctl', action.lower(), 'flocker-control'])])
 elif is_ubuntu(distribution):
  return sequence([put(path='/etc/init/flocker-control.override', content=dedent('                    start on runlevel [2345]\n                    stop on runlevel [016]\n                    ')), run("echo 'flocker-control-api DCTB 4523/tcp DCTB  DCTB  DCTB # Flocker Control API port' >> /etc/services"), run("echo 'flocker-control-agent DCTB 4524/tcp DCTB  DCTB  DCTB # Flocker Control Agent port' >> /etc/services"), run_from_args(['service', 'flocker-control', action.lower()])])
 else:
  raise DistributionNotSupported(distribution=distribution)

def task_enable_flocker_control ( distribution , action = 'start' ) : validate_start_action ( action ) if is_systemd_distribution ( distribution ) : return sequence ( [ run_from_args ( [ 'systemctl' , 'enable' , 'flocker-control' ] ) , run_from_args ( [ 'systemctl' , action . lower ( ) , 'flocker-control' ] ) ] ) elif is_ubuntu ( distribution ) : return sequence ( [ put ( path = '/etc/init/flocker-control.override' , content = dedent ( '                    start on runlevel [2345]\n                    stop on runlevel [016]\n                    ' ) ) , run ( "echo 'flocker-control-api DCTB 4523/tcp DCTB  DCTB  DCTB # Flocker Control API port' >> /etc/services" ) , run ( "echo 'flocker-control-agent DCTB 4524/tcp DCTB  DCTB  DCTB # Flocker Control Agent port' >> /etc/services" ) , run_from_args ( [ 'service' , 'flocker-control' , action . lower ( ) ] ) ] ) else : raise DistributionNotSupported ( distribution = distribution )
enable flocker-control service .