Exemplo n.º 1
0
  def update_asset_properties(self, props, name, existing_params=None):
    if existing_params is None:
      asset = self.get_asset_by_name(name, simplify=False)

      existing_params = AssetParameters(
        assetName=asset.theName,
        shortCode=asset.theShortCode,
        assetDesc=asset.theDescription,
        assetSig=asset.theSignificance,
        assetType=asset.theType,
        cFlag=asset.isCritical,
        cRationale=asset.theCriticalRationale,
        tags=asset.theTags,
        ifs=asset.theInterfaces,
        cProperties=[]
      )
      existing_params.setId(asset.theId)

    existing_params.theEnvironmentProperties = props

    try:
      self.db_proxy.updateAsset(existing_params)
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)
Exemplo n.º 2
0
    def update_asset_properties(self, props, name, existing_params=None):
        if existing_params is None:
            asset = self.get_asset_by_name(name, simplify=False)

            existing_params = AssetParameters(
                assetName=asset.theName,
                shortCode=asset.theShortCode,
                assetDesc=asset.theDescription,
                assetSig=asset.theSignificance,
                assetType=asset.theType,
                cFlag=asset.isCritical,
                cRationale=asset.theCriticalRationale,
                tags=asset.theTags,
                ifs=asset.theInterfaces,
                cProperties=[]
            )
            existing_params.setId(asset.theId)

        existing_params.theEnvironmentProperties = props

        try:
            self.db_proxy.updateAsset(existing_params)
        except DatabaseProxyException as ex:
            self.close()
            raise ARMHTTPError(ex)
        except ARMException as ex:
            self.close()
            raise ARMHTTPError(ex)