Be more user friendly and use clear text argument strings if possible.
Signed-off-by: Björn Baumbach <bb@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
from samba.samdb import SamDB
from samba.compat import get_bytes
from subprocess import check_call, CalledProcessError
+from . import common
from samba import (
credentials,
def run(self, computername, credopts=None, sambaopts=None, versionopts=None,
H=None, editor=None):
- from . import common
-
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
samdb = SamDB(url=H, session_info=system_session(),
samaccountname)
for msg in res:
- computer_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
+ computer_ldif = common.get_ldif_for_editor(samdb, msg)
self.outf.write(computer_ldif)
Option,
)
from samba.compat import get_bytes
+from . import common
class cmd_create(Command):
versionopts=None,
H=None,
editor=None):
- from . import common
-
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
samdb = SamDB(url=H, session_info=system_session(),
contactname)
for msg in res:
- contact_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
+ contact_ldif = common.get_ldif_for_editor(samdb, msg)
self.outf.write(contact_ldif)
from samba.compat import get_bytes
import os
import tempfile
+from . import common
security_group = dict({"Builtin": GTYPE_SECURITY_BUILTIN_LOCAL_GROUP,
"Domain": GTYPE_SECURITY_DOMAIN_LOCAL_GROUP,
raise CommandError('Unable to find group "%s"' % (groupname))
for msg in res:
- group_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
+ group_ldif = common.get_ldif_for_editor(samdb, msg)
self.outf.write(group_ldif)
def run(self, groupname, credopts=None, sambaopts=None, versionopts=None,
H=None, editor=None):
- from . import common
-
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
samdb = SamDB(url=H, session_info=system_session(),
from samba.compat import text_type
from samba.compat import get_bytes
from samba.compat import get_string
-
+from . import common
# python[3]-gpgme is abandoned since ubuntu 1804 and debian 9
# have to use python[3]-gpg instead
def run(self, username, credopts=None, sambaopts=None, versionopts=None,
H=None, editor=None):
- from . import common
-
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
samdb = SamDB(url=H, session_info=system_session(),
raise CommandError('Unable to find user "%s"' % (username))
for msg in res:
- user_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
+ user_ldif = common.get_ldif_for_editor(samdb, msg)
self.outf.write(user_ldif)