Project

General

Profile

Actions

Bug #2909

closed

the rados_trunc function did not get implemented in rados.py Python

Added by Evan Felix over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
librados
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

This code seems to work in the Ioctx class:

def trunc(self,key,size):
self.require_ioctx_open()
if not isinstance(key, str):
raise TypeError('key must be a string')
ret = self.librados.rados_trunc(self.io,c_char_p(key),c_size_t(size))
if ret < 0:
raise make_ex(ret, "Ioctx.trunc(%s): failed to truncate %s" % (self.name, key))
return ret
Actions #1

Updated by Josh Durgin over 11 years ago

  • Source changed from Community (user) to Community (dev)

That looks good to me. Can I add your signed-off-by to the patch?

Actions #2

Updated by Evan Felix over 11 years ago

Yes you may.

Actions #3

Updated by Josh Durgin over 11 years ago

  • Status changed from New to Resolved

Thanks! Added in 43291951fad241a6d3f8b8daa37d3665c9d842d6, with a simple test and spacing normalized to the rest of the file.

Actions

Also available in: Atom PDF