File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 5959_CLI_INSTANCE_PASSWORD : str | None = None
6060
6161
62- def SNowInstance ():
62+ def SNowInstance (snow_credentials : tuple [ str , str ] | None = None ):
6363 """
64- Wrapper around the standard SNowInstance that always uses CLI-provided credentials .
64+ Wrapper around the standard SNowInstance that uses CLI-provided instance URL and password if none are provided .
6565 """
66- if not _CLI_INSTANCE_URL or not _CLI_INSTANCE_PASSWORD :
67- raise RuntimeError ("Installer requires --instance-url and --instance-password arguments." )
66+ if not _CLI_INSTANCE_URL :
67+ raise RuntimeError ("Installer requires --instance-url to create a SNowInstance." )
68+
69+ resolved_creds = snow_credentials
70+
71+ if resolved_creds is None :
72+ if not _CLI_INSTANCE_PASSWORD :
73+ raise RuntimeError (
74+ "Installer requires --instance-password (or explicit credentials) to create a SNowInstance."
75+ )
76+ resolved_creds = ("admin" , _CLI_INSTANCE_PASSWORD )
77+
6878 return _BaseSNowInstance (
6979 snow_url = _CLI_INSTANCE_URL ,
70- snow_credentials = ( "admin" , _CLI_INSTANCE_PASSWORD ) ,
80+ snow_credentials = resolved_creds ,
7181 )
7282
7383
You can’t perform that action at this time.
0 commit comments