
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip


get_ip = get_local_ip
send_event = send_riemann_event


@task
def start(__cloudify_id, port=8080, **kwargs):
  print 'HELLO BASH! %s' % port
  send_event(__cloudify_id, get_ip(), "hello_bash status", "state", "running")


from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip


get_ip = get_local_ip
send_event = send_riemann_event


@task
def start(__cloudify_id, port=8080, **kwargs):
  with open('/tmp/HELLO', 'w') as f:
    print >> f, 'HELLO BASH! %s' % port
  send_event(__cloudify_id, get_ip(), "hello_bash status", "state", "running")

Send the output to a tmp file
Send the output to a tmp file

  
  from celery import task
  from cosmo.events import send_event as send_riemann_event
  from cloudify.utils import get_local_ip
  
  
  get_ip = get_local_ip
  send_event = send_riemann_event
  
  
  @task
  def start(__cloudify_id, port=8080, **kwargs):
+   with open('/tmp/HELLO', 'w') as f:
-   print 'HELLO BASH! %s' % port
+     print >> f, 'HELLO BASH! %s' % port
    send_event(__cloudify_id, get_ip(), "hello_bash status", "state", "running")
  
Send the output to a tmp file
## Code Before:

from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip


get_ip = get_local_ip
send_event = send_riemann_event


@task
def start(__cloudify_id, port=8080, **kwargs):
  print 'HELLO BASH! %s' % port
  send_event(__cloudify_id, get_ip(), "hello_bash status", "state", "running")

## Instruction:
Send the output to a tmp file
## Code After:

from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip


get_ip = get_local_ip
send_event = send_riemann_event


@task
def start(__cloudify_id, port=8080, **kwargs):
  with open('/tmp/HELLO', 'w') as f:
    print >> f, 'HELLO BASH! %s' % port
  send_event(__cloudify_id, get_ip(), "hello_bash status", "state", "running")
