-
Notifications
You must be signed in to change notification settings - Fork 73
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
Skip DFS referrals without referral_entries #149
Conversation
Codecov Report
@@ Coverage Diff @@
## master #149 +/- ##
==========================================
+ Coverage 98.93% 99.09% +0.15%
==========================================
Files 23 23
Lines 5052 5059 +7
==========================================
+ Hits 4998 5013 +15
+ Misses 54 46 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
666c201
to
dee6c18
Compare
Interesting, I’ll have to have a closer look at the DFS docs to see when this would occur. Do you have more information about the environment where this occurred for you? |
This error occured on |
No worries, I'll have to try and replicate but considering it's happening in real life I don't see why this check can't occur |
The docs seems to at least mention this is possible
Seems like more handling will need to be done to check that |
I've pushed a commit that adds the exception handling as well as some hacky tests. If you get a change it would be great if you could try it out on your environment to make sure I didn't break anything. I would expect a DFS share with no referrals to raise |
Thanks for your commit and looking up how to handle empty referrals in the documentation. You missed one place ( Now everything works as expected in my environment. Feel free to merge. |
Ah thanks for the pickup, I completely forgot about this use of DFS. Appreciate the time and effort fixing this up. |
Hi,
I have encountered an
IndexError
in classReferralEntry
whenDFSReferralResponse
contains noreferral_entries
(i.e.number_of_referrals
is 0).ReferralEntry
assumes that there is always at least one entry available.In my pull request I decided to not create instances of
ReferralEntry
at all whennumber_of_referrals
is 0. This is outside of the class and does not mitigate the root problem. However, the only place whereReferralEntry
instances are created is inClientConfig.cache_referral()
.Another possibility would be to check if
referral_entries
are available in each method ofReferralEntry
and returnNone
. I think this would cause further problems since methods do no longer guarantee to return a value butNone
instead. This also needs adaptions in code calling these methods.I would appreciate feedback what you think is the best way to solve this error.