#NEWLINE# def check( jail = None , chroot = None , depends = False , recompute = False , checksum = False ) : #NEWLINE# #INDENT# "\n    Sanity checks installed packages\n\n    jail\n        Perform the sanity check in the specified jail\n\n        CLI Example:\n\n        .. code-block:: bash\n\n            salt '*' pkg.check jail=<jail name or id>\n\n    chroot\n        Perform the sanity check in the specified chroot (ignored if ``jail``\n        is specified)\n\n        CLI Example:\n\n        .. code-block:: bash\n\n            salt '*' pkg.check chroot=/path/to/chroot\n\n\n    Of the below, at least one must be set to ``True``.\n\n    depends\n        Check for and install missing dependencies.\n\n        CLI Example:\n\n        .. code-block:: bash\n\n            salt '*' pkg.check recompute=True\n\n    recompute\n        Recompute sizes and checksums of installed packages.\n\n        CLI Example:\n\n        .. code-block:: bash\n\n            salt '*' pkg.check depends=True\n\n    checksum\n        Find invalid checksums for installed packages.\n\n        CLI Example:\n\n        .. code-block:: bash\n\n            salt '*' pkg.check checksum=True\n    " #NEWLINE# if ( not any ( ( depends , recompute , checksum ) ) ) : #NEWLINE# #INDENT# return 'One of depends, recompute, or checksum must be set to True' #NEWLINE# #UNINDENT# opts = '' #NEWLINE# if depends : #NEWLINE# #INDENT# opts += 'dy' #NEWLINE# #UNINDENT# if recompute : #NEWLINE# #INDENT# opts += 'r' #NEWLINE# #UNINDENT# if checksum : #NEWLINE# #INDENT# opts += 's' #NEWLINE# #UNINDENT# cmd = _pkg ( jail , recompute ) #NEWLINE# cmd . append ( 'check' ) #NEWLINE# if opts : #NEWLINE# #INDENT# cmd . append ( ( '-' + opts ) ) #NEWLINE# #UNINDENT# return __salt__ [ 'cmd.run' ] ( cmd , output_loglevel = 'trace' , python_shell = False )