Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cryo:new to cryo:init #655

Merged
merged 1 commit into from
Feb 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions synapse/cryotank.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def handlers(self):
CryoCell message handlers.
'''
return {
'cryo:new': self._onCryoNew,
'cryo:init': self._onCryoInit,
'cryo:list': self._onCryoList,
'cryo:last': self._onCryoLast,
'cryo:puts': self._onCryoPuts,
Expand Down Expand Up @@ -367,7 +367,7 @@ def _onCryoPuts(self, chan, mesg):
tank.puts(items)

@s_glob.inpool
def _onCryoNew(self, chan, mesg):
def _onCryoInit(self, chan, mesg):
name = mesg[1].get('name')
conf = mesg[1].get('conf')

Expand Down Expand Up @@ -516,7 +516,7 @@ def metrics(self, name, offs, size, timeout=None):
mesg = ('cryo:metrics', {'name': name, 'offs': offs, 'size': size})
return self._cryo_sess.call(mesg, timeout=timeout)

def new(self, name, conf=None, timeout=None):
def init(self, name, conf=None, timeout=None):
'''
Create a new named Cryotank.

Expand All @@ -529,5 +529,5 @@ def new(self, name, conf=None, timeout=None):
True if the tank was created, False if the tank existed or
there was an error during CryoTank creation.
'''
mesg = ('cryo:new', {'name': name, 'conf': conf})
mesg = ('cryo:init', {'name': name, 'conf': conf})
return self._cryo_sess.call(mesg, timeout=timeout)
6 changes: 3 additions & 3 deletions synapse/tests/test_cryotank.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def test_cryo_cell(self):
self.len(1, (user.metrics('woot:hehe', 0, 100)))

# We can initialize a new tank directly with a custom map size
self.true(user.new('weee:imthebest', {'mapsize': 5558675309}))
self.false(user.new('woot:hehe'))
self.true(user.init('weee:imthebest', {'mapsize': 5558675309}))
self.false(user.init('woot:hehe'))
with self.getLoggerStream('synapse.cryotank') as stream:
self.false(user.new('weee:danktank', {'newp': 'hehe'}))
self.false(user.init('weee:danktank', {'newp': 'hehe'}))
stream.seek(0)
mesgs = stream.read()
self.isin('Error making CryoTank', mesgs)
Expand Down