from P4 import P4,P4Exception # Import the module p4 = P4() # Create the P4 instance p4.client = "something" p4.host = "foo.bar.bang.com" p4.password = "password1" p4.port = "1234" p4.user = "something" p4.exception_level = 2 print p4.connect try: # Catch exceptions with try/except p4.connect() # Connect to the Perforce Server print "Connected" info = p4.run("info") # Run "p4 info" (returns a dict) for key in info: # and display all key-value pairs print key, "=", info[key] except P4Exception, ex: print ex
I get to the exception which reads:
[P4.connect()] Connect to server failed; check $P4PORT. TCP connect to 1234 failed. connect: 127.0.0.1:1234: Connection refused
So it seems the connection being attempted is to localhost instead of "foo.bar.bang.com". Any help would be greatly appreciated. I am new to Perforce so I am unsure of all the variables at play.