<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python task output to an input to shell task in HPE Morpheus Enterprise</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/python-task-output-to-an-input-to-shell-task/m-p/7247131#M305</link>
    <description>&lt;P&gt;How to pass python task output to an input to shell task&lt;BR /&gt;
Python task name is PR_US&lt;BR /&gt;
I created below variable in shell script to store result of PR_US&lt;BR /&gt;
target_host = morpheus[‘results’][‘PR_US’]&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 06:16:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2023-08-18T06:16:36Z</dc:date>
    <item>
      <title>Python task output to an input to shell task</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/python-task-output-to-an-input-to-shell-task/m-p/7247131#M305</link>
      <description>&lt;P&gt;How to pass python task output to an input to shell task&lt;BR /&gt;
Python task name is PR_US&lt;BR /&gt;
I created below variable in shell script to store result of PR_US&lt;BR /&gt;
target_host = morpheus[‘results’][‘PR_US’]&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 06:16:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/python-task-output-to-an-input-to-shell-task/m-p/7247131#M305</guid>
      <dc:creator />
      <dc:date>2023-08-18T06:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python task output to an input to shell task</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise/python-task-output-to-an-input-to-shell-task/m-p/7247132#M306</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;Please find the doc link &lt;A href="https://docs.morpheusdata.com/en/6.0.6/library/automation/tasks/taskResults.html" class="inline-onebox"&gt;Task Results — Morpheus Docs documentation&lt;/A&gt;&lt;BR /&gt;
Please find the video explanation for the above.&lt;BR /&gt;
&lt;A href="https://www.youtube.com/watch?v=UiVp2BTYwU4"&gt;https://www.youtube.com/watch?v=UiVp2BTYwU4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;python Source Task with code sourceTask&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-python"&gt;import socket

def get_hostname():
    return socket.gethostname()

if __name__ == "__main__":
    hostname = get_hostname()
    print("Hostname:", hostname)

shell Result task
echo "single: &amp;lt;%=results.sourceTask%&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;if you have added the 2 tasks in an operational workflow and executed the workflow you can see the source task returns “Hostname: xyz” and the Result task returns “single: Hostname: xyz”&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;
Velan&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 06:30:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise/python-task-output-to-an-input-to-shell-task/m-p/7247132#M306</guid>
      <dc:creator />
      <dc:date>2023-08-18T06:30:33Z</dc:date>
    </item>
  </channel>
</rss>

