def _createSpServiceOsh(self, name, content, container): serviceOsh = ObjectStateHolder("sharepoint_service") serviceOsh.setAttribute('data_name', name) serviceOsh.setContainer(container) if content: bytes = String(content).getBytes() zipper = ChecksumZipper() zippedBytes = zipper.zip(bytes) #3000 is field size in sharepoint_service CMDB class if len(zippedBytes) <= 3000: serviceOsh.setBytesAttribute('document_data', zippedBytes) return serviceOsh
def stringToZippedBytesArray(value): zipper = ChecksumZipper() return zipper.zip(stringToBytesArray(value))
def _getContentBytes(self, contentString): if not contentString: raise ValueError("content is empty") bytes = String(contentString).getBytes() zipper = ChecksumZipper() zippedBytes = zipper.zip(bytes) return zippedBytes