def load_fsmo_roles(self, samdb):
        """Given an NC replica which has been discovered thru the nTDSDSA
        database object, load the fSMORoleOwner attribute.
        """
        try:
            res = samdb.search(base=self.nc_dnstr, scope=ldb.SCOPE_BASE,
                               attrs=[ "fSMORoleOwner" ])

        except ldb.LdbError, (enum, estr):
            raise Exception("Unable to find NC for (%s) - (%s)" %
                            (self.nc_dnstr, estr))

        msg = res[0]

        # Possibly no fSMORoleOwner
        if "fSMORoleOwner" in msg:
            self.rep_fsmo_role_owner = msg["fSMORoleOwner"]
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/kcc_utils.py/NCReplica.load_fsmo_roles/original