Advertisement
alacercogitatus

Argumenting?

Oct 3rd, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. sta, options = si.getKeywordsAndOptions()
  2. search_type_arg = sta[0]
  3. logger.debug('setting a default search_type')
  4. search_type = ALLHOSTS_SEARCH_CONST
  5. logger.debug('checking for proper arguments (%s)'%(search_type_arg))
  6. if len(search_type_arg) == 0:
  7. si.generateErrorResults('Requires either the "all_hosts" OR "fact_names" keyword')
  8. exit(0)
  9. logger.debug('checking for other keywords (%s)'%(search_type_arg))
  10. if search_type_arg == "fact_names":
  11. search_type = FACT_NAME_SEARCH_CONST
  12. logger.debug('checking for search_type not in SRCH_OPTIONS')
  13. if search_type not in SRCH_OPTIONS:
  14. si.generateErrorResults('Search Type Not Found')
  15. exit(0)
  16. logger.debug('starting function %s'%(search_type))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement