From 9fc2e6c352726d9b14afb5defaee399d20cf9b23 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Jan 2011 01:13:09 +0100 Subject: Use TestCase.get_credentials() where possible. --- source4/torture/libnet/python/samr-test.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/torture/libnet/python/samr-test.py') diff --git a/source4/torture/libnet/python/samr-test.py b/source4/torture/libnet/python/samr-test.py index a63236b7e6..fcd31c4b02 100644 --- a/source4/torture/libnet/python/samr-test.py +++ b/source4/torture/libnet/python/samr-test.py @@ -32,16 +32,14 @@ from samba import net import samba.tests if not "ACCOUNT_NAME" in os.environ.keys(): - parser.error("Please supply ACCOUNT_NAME in environment") + raise Exception("Please supply ACCOUNT_NAME in environment") if not "NEW_PASS" in os.environ.keys(): - parser.error("Please supply NEW_PASS in environment") + raise Exception("Please supply NEW_PASS in environment") account_name = os.environ["ACCOUNT_NAME"] new_pass = os.environ["NEW_PASS"] -creds = samba.tests.cmdline_credentials - # # Tests start here # @@ -51,6 +49,7 @@ class Libnet_SetPwdTest(samba.tests.TestCase): ######################################################################################## def test_SetPassword(self): + creds = self.get_credentials() net.SetPassword(account_name=account_name, domain_name=creds.get_domain(), newpassword=new_pass, -- cgit