Skip to content

Commit

Permalink
Merge pull request #655 from vEpiphyte/fix_cryo_init
Browse files Browse the repository at this point in the history
Rename cryo:new to cryo:init
  • Loading branch information
vEpiphyte authored Feb 8, 2018
2 parents d010700 + 231213c commit b27ae38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit b27ae38

Please sign in to comment.