Skip to content

Commit

Permalink
Merge pull request #868 from MetPX/issue864
Browse files Browse the repository at this point in the history
turn off magic support if redhat library present.
  • Loading branch information
petersilva authored Dec 15, 2023
2 parents d0d1d4d + a2798da commit bbde838
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sarracenia/featuredetection.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

logger = logging.getLogger(__name__)


features = {
'amqp' : { 'modules_needed': [ 'amqp' ], 'present': False,
'lament' : 'cannot connect to rabbitmq brokers',
Expand Down Expand Up @@ -116,3 +115,10 @@
logger.debug( f"extra feature {x} needs missing module {y}. Disabled" )
features[x]['present']=False


if features['filetypes']['present']:
import magic
if not hasattr(magic,'from_file'):
features['filetypes']['present'] = False
logger.debug( f'redhat magic bindings not supported.')

0 comments on commit bbde838

Please sign in to comment.