From 505228d9e50ce59a77f4a7f864f091e8f015df70 Mon Sep 17 00:00:00 2001 From: "David E. Eisenstat" Date: Fri, 23 Feb 2007 18:15:33 +0000 Subject: [PATCH] Make delegates work again and add an Emulab account. --- accounts.py | 2 +- delegate.py | 2 +- sm.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/accounts.py b/accounts.py index fe0af53..1b8c8a8 100644 --- a/accounts.py +++ b/accounts.py @@ -67,7 +67,7 @@ class Account: self.configure(rec) @staticmethod - def create(name): abstract + def create(name, vref = None): abstract @staticmethod def destroy(name): abstract diff --git a/delegate.py b/delegate.py index bb0942b..73a0743 100644 --- a/delegate.py +++ b/delegate.py @@ -10,7 +10,7 @@ class Delegate(accounts.Account): TYPE = 'delegate' @staticmethod - def create(name): + def create(name, vref = None): add_shell(Delegate.SHELL) logger.log_call('/usr/sbin/useradd', '-p', '*', '-s', Delegate.SHELL, name) diff --git a/sm.py b/sm.py index 956a11e..680120c 100644 --- a/sm.py +++ b/sm.py @@ -57,6 +57,17 @@ def GetSlivers(data, fullupdate=True): if network['is_primary'] and network['bwlimit'] is not None: DEFAULT_ALLOCATION['net_max_rate'] = network['bwlimit'] / 1000 +### Emulab-specific hack begins here + emulabdelegate = { + 'instantiation': 'plc-instantiated', + 'keys': '''ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Rimz6osRvlAUcaxe0YNfGsLL4XYBN6H30V3l/0alZOSXbGOgWNdEEdohwbh9E8oYgnpdEs41215UFHpj7EiRudu8Nm9mBI51ARHA6qF6RN+hQxMCB/Pxy08jDDBOGPefINq3VI2DRzxL1QyiTX0jESovrJzHGLxFTB3Zs+Y6CgmXcnI9i9t/zVq6XUAeUWeeXA9ADrKJdav0SxcWSg+B6F1uUcfUd5AHg7RoaccTldy146iF8xvnZw0CfGRCq2+95AU9rbMYS6Vid8Sm+NS+VLaAyJaslzfW+CAVBcywCOlQNbLuvNmL82exzgtl6fVzutRFYLlFDwEM2D2yvg4BQ== root@boss.emulab.net''', + 'name': 'utah_elab_delegate', + 'timestamp': data['timestamp'], + 'type': 'delegate', + 'vref': None + } + database.db.deliver_record(emulabdelegate) +### Emulab-specific hack ends here for sliver in data['slivers']: rec = sliver.copy() rec.setdefault('timestamp', data['timestamp']) -- 2.43.0