Hi jar,
You can do something like this:
output1 = connection.send_command('show version| match Hostname')
output1 += (connection.send_command('show version| match Model'))
output1 += (connection.send_command('show version| match Junos:'))
print (re.sub('\{|master|\:|0|\}|\\n','',output1))
This removes newline and spaces from every line and gets you something like this:
Hostname:R2Model:qfx5100-48s-6qJunos:14.1X53-D49_vjunos.79
Else, do it like:
output1 = connection.send_command('show version| match Hostname')
output2 = (connection.send_command('show version| match Model'))
output3 = (connection.send_command('show version| match Junos:'))
print (re.sub('\\n','',output1))
print (re.sub('\\n','',output2))
print (re.sub('\\n','',output3))
And remove the {master:} part using "print (re.sub('\{|master|\:|0|\}|\\n','',output1))" from whichever output it applies.
-r.
--------------------------------------------------
If this solves your problem, please mark this post as "Accepted Solution."
Kudos are always appreciated Smiley Happy.