-
Notifications
You must be signed in to change notification settings - Fork 53
Invoking oracle clone using NetBackup APIs. #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than the wording comments we chatted about.
Looks good to me. |
INSTANCE_NAME = ARGS.mssql_instance | ||
DATABASE_NAME = ARGS.mssql_database | ||
ALT_DB_PATH = ARGS.restore_db_path | ||
ALLDATABASES=[] | ||
print(f"User authentication completed for master server:[{ARGS.master_server}]") | ||
print(f"User authentication completed for primary server:[{ARGS.primary_server}]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use some async-await methods here to ensure the message is printed only if the common.get_authenticate_token
process is done and successfully generates a token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is mssql scripts so i am not changing the functionality - this change is only to remove "master" usage
print("Pre-recovery check failed. Force kick off clone using --force_clone") | ||
|
||
finally: | ||
print("To cleanup the cloned instance, run dbca. Add the instance to /etc/oratab to be discovered by oracle for cleanup.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this script mainly created for Linux users? If not, should we add cleanup suggestions for Windows users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, for windows they only need to run dbca. so thats the first half and the second part in case the instance is not discovered and doesn't appear on dbca
|
||
asset_id = response_text['data'][0]['id'] | ||
|
||
print(f"Client asset Id:[{asset_id}]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make it guaranteed that this print method runs only if the asset_id is populated after getting a response? So that we can avoid asset_id being null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just curious why we are not using async functions here. Since we have HTTP request or RESTAPI calls, each execution may not happen synchronously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you see that anything is happening asynchronously here? It looks to me like common.rest_request
issues a GET request and waits for the result. The function won't return until that happens.
b17e5f0
to
8700eca
Compare
8700eca
to
1d822a4
Compare
# Get oracle_asset info | ||
def get_oracle_asset_info(baseurl, token, asset_type, display_name, database_id): | ||
""" This function return the asset info """ | ||
print(f"Get client asset info for Oracle type :[asset_type]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This f-string is missing its braces.
|
||
asset_id = response_text['data'][0]['id'] | ||
|
||
print(f"Client asset Id:[{asset_id}]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you see that anything is happening asynchronously here? It looks to me like common.rest_request
issues a GET request and waits for the result. The function won't return until that happens.
No description provided.