def METHOD_NAME(self, princ, password=None):
    args = ["kadmin.local", "-q"]
    if password is None:
        args += ["addprinc -randkey %s" % (princ)]
    else:
        args += ["addprinc -pw %s %s" % (password, princ)]
    return self._run_in_env(args, self.get_krb5_env())