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
ceph: Allowing ceph filesystem argument to be optional #5931
ceph: Allowing ceph filesystem argument to be optional #5931
Conversation
@leseb , can you please take a look? |
cf6e4df
to
e047834
Compare
if len(json_out) > 1 and not self._arg_parser.cephfs_filesystem_name: | ||
# if the arguments are not provided, generate an error message | ||
# if there is an unsuccessful attempt, report an error | ||
if ret_val != 0: |
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.
Even if the command fails I wouldn't report an error.
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.
Changed...
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.
But @leseb , don't you think when the underlying command itself fails, the user has to be notified.
Otherwise user will provide the arguments (through command line) and when the command fails we will silently reset the args and continue.
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.
As a proof of concept changed this part, please take a look. If you think this is not the correct behaviour, will revert the changes (to the non-error / silent return one)
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 think the latter looks good, thanks.
# if there is no matching fs exists, that means provided data_pool name is invalid | ||
if not matching_json_out: | ||
raise ExecutionFailureException( | ||
"Provided data_pool name, {}, doesn't exists".format( |
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.
"Provided data_pool name, {}, doesn't exists".format( | |
"Provided data_pool name, {}, does not exist".format( |
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.
Done.
e047834
to
65fc7c1
Compare
65fc7c1
to
a2c3604
Compare
If we are unable to get or infer a default value for ceph filesystem script won't be throwing an error. Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
'ceph-rgw' storageclass will be provided only if 'rgw_endpoint' exists 'cephfs' storageclass will be provided only if ceph-fs and/or data-pool parameters are valid. Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
a2c3604
to
cba605a
Compare
if len(json_out) > 1 and not self._arg_parser.cephfs_filesystem_name: | ||
# if the arguments are not provided, generate an error message | ||
# if there is an unsuccessful attempt, report an error | ||
if ret_val != 0: |
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 think the latter looks good, thanks.
@aruniiird please rebase to master |
ceph: Allowing ceph filesystem argument to be optional (bp #5931)
If we are unable to get a default ceph data pool name,
script won't be throwing an error.
Signed-off-by: Arun Kumar Mohan amohan@redhat.com
Description of your changes:
Which issue is resolved by this Pull Request:
Resolves #
Checklist:
make codegen
) has been run to update object specifications, if necessary.[skip ci]