Azure / azure-storage-ruby

Microsoft Azure Storage Library for Ruby
http://azure.github.io/azure-storage-ruby/
84 stars 150 forks source link

Define PRIVATE_RANGES in IPAddr class #186

Closed bsawicki closed 2 years ago

bsawicki commented 3 years ago

This class appears to be a duplicate of the IPAddr class found in common/lib/azure/core/utility.rb, however this version does not define the constant PRIVATE_RANGES. This is manifesting as an error that appears as follows:

E, [2021-03-29T01:34:52.651460 #756] ERROR -- : app error: uninitialized constant IPAddr::PRIVATE_RANGES (NameError)
E, [2021-03-29T01:34:52.651585 #756] ERROR -- : /var/www/discourse/plugins/discourse-azure-blob-storage/gems/2.7.2/gems/azure-storage-common-2.0.2/lib/azure/storage/common/core/utility.rb:218:in `private?'

I'm not 100% sure why this is manifesting now in my usage where it didn't before, but I believe this to be the root cause. Please let me know if you have any questions.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.002%) to 87.033% when pulling 71123ebb621238b94dda16d01b466fd012f16f0d on bsawicki:master into 05ea58af3859edda790e769be5beba7fcfb73c0f on Azure:master.

katmsft commented 3 years ago

Interesting, I think the best approach is to de-duplicate those classes. However, this also looks good.

bsawicki commented 3 years ago

I agree a de-dup makes sense, but I personally do not have the free time to undertake it at this point. Given that this is currently affecting at least me and who knows who else, I think accepting this as a stopgap and allowing me to add a TODO or open an issue for the de-dup would be a good path forward. Please advise on how you'd like me to do that and I'm happy to. If this is acceptable please go ahead and approve.