Code Duplication    Length = 11-11 lines in 2 locations

gvm/protocols/gmpv7/types.py 1 location

@@ 387-397 (lines=11) @@
384
    SCAP = "SCAP"
385
386
387
def get_feed_type_from_string(feed_type: Optional[str]) -> Optional[FeedType]:
388
    """Convert a feed type string into a FeedType instance"""
389
    if not feed_type:
390
        return None
391
392
    try:
393
        return FeedType[feed_type.upper()]
394
    except KeyError:
395
        raise InvalidArgument(
396
            argument='feed_type', function=get_feed_type_from_string.__name__
397
        ) from None
398
399
400
class FilterType(Enum):

gvm/protocols/gmpv208/types.py 1 location

@@ 159-169 (lines=11) @@
156
    GVMD_DATA = "GVMD_DATA"
157
158
159
def get_feed_type_from_string(feed_type: Optional[str]) -> Optional[FeedType]:
160
    """Convert a feed type string into a FeedType instance"""
161
    if not feed_type:
162
        return None
163
164
    try:
165
        return FeedType[feed_type.upper()]
166
    except KeyError:
167
        raise InvalidArgument(
168
            argument='feed_type', function=get_feed_type_from_string.__name__
169
        ) from None
170
171
172
class FilterType(Enum):