s4-fsmo: samba-tool fsmo takes a URL, not a hostname
authorAndrew Tridgell <tridge@samba.org>
Mon, 28 Mar 2011 03:17:45 +0000 (14:17 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 28 Mar 2011 22:00:22 +0000 (00:00 +0200)
better to call the option --url

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/scripting/python/samba/netcmd/fsmo.py
source4/torture/drs/python/fsmo.py

index 0c8d17c74f05cce51b09c043eff4196210e734b0..df6bb20ba3e3c65e421ba14f2b9a48555779cd70 100644 (file)
@@ -43,7 +43,7 @@ class cmd_fsmo(Command):
         }
 
     takes_options = [
-        Option("--host", help="LDB URL for database or target server", type=str),
+        Option("--url", help="LDB URL for database or target server", type=str),
         Option("--force", help="Force seizing of the role without attempting to transfer first.", action="store_true"),
         Option("--role", type="choice", choices=["rid", "pdc", "infrastructure","schema","naming","all"],
                help="""The FSMO role to seize or transfer.\n
@@ -130,12 +130,12 @@ all=all of the above"""),
                 "fSMORoleOwner")
             samdb.modify(m)
 
-    def run(self, subcommand, force=None, host=None, role=None,
+    def run(self, subcommand, force=None, url=None, role=None,
             credopts=None, sambaopts=None, versionopts=None):
         lp = sambaopts.get_loadparm()
         creds = credopts.get_credentials(lp, fallback_machine=True)
 
-        samdb = SamDB(url=host, session_info=system_session(),
+        samdb = SamDB(url=url, session_info=system_session(),
             credentials=creds, lp=lp)
 
         domain_dn = samdb.domain_dn()
index c137c7e8e5745e08cdc7a290486ce09c47418383..f1fa6ef1fdea04fd2d9c618e8919b5e9e74477b8 100644 (file)
@@ -61,8 +61,8 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase):
         creds = self.get_credentials()
         cmd_line_auth = "-U%s/%s%%%s" % (creds.get_domain(),
                                          creds.get_username(), creds.get_password())
-        # bin/samba-tool fsmo transfer --role=role --host=ldap://DC:389
-        cmd_line = "%s fsmo transfer --role=%s --host=ldap://%s:389 %s" % (net_cmd, role, DC,
+        # bin/samba-tool fsmo transfer --role=role --url=ldap://DC:389
+        cmd_line = "%s fsmo transfer --role=%s --url=ldap://%s:389 %s" % (net_cmd, role, DC,
                                                                            cmd_line_auth)
         ret = os.system(cmd_line)
         self.assertEquals(ret, 0, "Transferring role %s to %s has failed!" % (role, DC))