adtrust install: define constants for rid bases

Define constants for DEFAULT_PRIMARY_RID_BASE = 1000 and
DEFAULT_SECONDARY_RID_BASE = 100000000

Related: https://pagure.io/freeipa/issue/8995
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Florence Blanc-Renaud 2021-10-08 11:37:26 +02:00
parent 5541b9d69f
commit b054532658
2 changed files with 8 additions and 4 deletions

View File

@ -64,10 +64,11 @@ def parse_options():
parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true",
default=False, help=SUPPRESS_HELP)
parser.add_option("--rid-base", dest="rid_base", type=int, default=1000,
parser.add_option("--rid-base", dest="rid_base", type=int,
default=adtrust.DEFAULT_PRIMARY_RID_BASE,
help="Start value for mapping UIDs and GIDs to RIDs")
parser.add_option("--secondary-rid-base", dest="secondary_rid_base",
type=int, default=100000000,
type=int, default=adtrust.DEFAULT_SECONDARY_RID_BASE,
help="Start value of the secondary range for mapping "
"UIDs and GIDs to RIDs")
parser.add_option("-U", "--unattended", dest="unattended",

View File

@ -39,6 +39,9 @@ logger = logging.getLogger(__name__)
netbios_name = None
reset_netbios_name = False
DEFAULT_PRIMARY_RID_BASE = 1000
DEFAULT_SECONDARY_RID_BASE = 100000000
def netbios_name_error(name):
logger.error("\nIllegal NetBIOS name [%s].\n", name)
@ -553,12 +556,12 @@ class SIDInstallInterface(ServiceAdminInstallInterface):
)
rid_base = knob(
int,
1000,
DEFAULT_PRIMARY_RID_BASE,
description="Start value for mapping UIDs and GIDs to RIDs"
)
secondary_rid_base = knob(
int,
100000000,
DEFAULT_SECONDARY_RID_BASE,
description="Start value of the secondary range for mapping "
"UIDs and GIDs to RIDs"
)