def cluster_remove(version, name='main', stop=False):
 cmd = [salt.utils.which('pg_dropcluster')]
 if stop:
  cmd += ['--stop']
 cmd += [version, name]
 cmdstr = ' '.join([pipes.quote(c) for c in cmd])
 ret = __salt__['cmd.run_all'](cmdstr, python_shell=False)
 if (ret.get('retcode', 0) != 0):
  log.error('Error removing a Postgresql cluster {0}/{1}'.format(version, name))
 else:
  ret['changes'] = 'Successfully removed cluster {0}/{1}'.format(version, name)
 return ret

def cluster_remove ( version , name = 'main' , stop = False ) : cmd = [ salt . utils . which ( 'pg_dropcluster' ) ] if stop : cmd += [ '--stop' ] cmd += [ version , name ] cmdstr = ' ' . join ( [ pipes . quote ( c ) for c in cmd ] ) ret = __salt__ [ 'cmd.run_all' ] ( cmdstr , python_shell = False ) if ( ret . get ( 'retcode' , 0 ) != 0 ) : log . error ( 'Error removing a Postgresql cluster {0}/{1}' . format ( version , name ) ) else : ret [ 'changes' ] = 'Successfully removed cluster {0}/{1}' . format ( version , name ) return ret
remove a cluster on a postgres server .