Example #1
0
    def _build_data(self):
        """Construct the payload for a scan given our arguments.

        :returns: a dictionary representing the scan being added
        """
        self.req_payload = {
            'name': self.args.name,
            'sources': self.source_ids,
            'scan_type': scan.SCAN_TYPE_INSPECT,
            'options': {}
        }
        if self.args.max_concurrency:
            self.req_payload['options']['max_concurrency'] \
                = self.args.max_concurrency
        disabled_optional_products \
            = get_optional_products(self.args.disabled_optional_products)
        enabled_ext_product_search \
            = get_enabled_products(self.args.enabled_ext_product_search,
                                   self.args.ext_product_search_dirs, False)
        if disabled_optional_products is not None:
            self.req_payload['options']['disabled_optional_products']\
                = disabled_optional_products
        if enabled_ext_product_search is not None:
            self.req_payload['options']['enabled_extended_product_search'] \
                = enabled_ext_product_search
Example #2
0
 def test_default_extended_search_values(self):
     """Testing the scan default extended searchvalues."""
     disabled_default = {
         JBOSS_FUSE: False,
         JBOSS_EAP: False,
         JBOSS_BRMS: False,
         JBOSS_WS: False,
         'search_directories': []
     }
     result = get_enabled_products([], [], True)
     self.assertEqual(disabled_default, result)
Example #3
0
    def _build_data(self):
        """Construct the payload for a scan edit given our arguments.

        :returns: a dictionary representing the scan changes
        """
        disabled_optional_products \
            = get_optional_products(self.args.disabled_optional_products)
        enabled_ext_product_search \
            = get_enabled_products(self.args.enabled_ext_product_search,
                                   self.args.ext_product_search_dirs, True)
        self.req_payload \
            = build_scan_payload(self.args,
                                 self.source_ids,
                                 disabled_optional_products,
                                 enabled_ext_product_search)