code: def put_object(self, cont, obj, local_file):
          '''
          Upload a file to Swift
          '''
          try:
              with salt.utils.files.fopen(local_file, 'rb') as fp_:
                  self.conn.put_object(cont, obj, fp_)
              return True
          except Exception as exc:
              log.error('There was an error::')
              if hasattr(exc, 'code') and hasattr(exc, 'msg'):
                  log.error('    Code: %s: %s', exc.code, exc.msg)
              log.error('    Content: \n%s', getattr(exc, 'read', lambda: six.text_type(exc))())
              return Falsf put_object(self, cont, obj, local_file):
          '''
          Upload a file to Swift
          '''
          try:
              with salt.utils.files.fopen(local_file, 'rb') as fp_:
                  self.conn.put_object(cont, obj, fp_)
              return True
          except Exception as exc:
              log.error('There was an error::')
              if hasattr(exc, 'code') and hasattr(exc, 'msg'):
                  log.error('    Code: %s: %s', exc.code, exc.msg)
              log.error('    Content: \n%s', getattr(exc, 'read', lambda: six.text_type(exc))())
              return False
docs: Upload a file to Swift