def makeUser(self, server, p): """ create the actual user and return the password """ # @TODO: move makeUser to an auto-setup script # @TODO: make actual user object, then reuse logic in addnew script assert isinstance(p, Signup) assert p.plan is not None, "signup didn't have a plan" assert p.username is not None, "didn't have a username" assert p.fullname is not None, "didn't have a fullname" res = remote.getBeaker(server).addnew(p.plan, p.username, p.fullname) return res.strip().split()[-1] # from "password for user is pass"
def getBeaker(self): assert self.name return remote.getBeaker(self.name)
def invoke(self, server): beaker = remote.getBeaker(server) return Model( message="restarting apache on %s: %s" \ % (server, beaker.genhttpconf()))