Changeset 53b5c18


Ignore:
Timestamp:
Oct 4, 2011 7:34:51 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
2933343, f3898f7
Parents:
121aa1c
Message:

Avoid names that are too long

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    r121aa1c r53b5c18  
    5151    """
    5252
     53    max_name_len = 19
     54
    5355    def __init__(self, config=None, auth=None):
    5456        """
     
    5759
    5860        access_base.__init__(self, config, auth)
     61
     62        self.max_name_len = access.max_name_len
    5963
    6064        self.allow_proxy = config.getboolean("access", "allow_proxy")
     
    950954                ename = a['value']
    951955
    952         if ename:
     956        # Names longer than the emulab max are discarder
     957        if ename and len(ename) <= self.max_name_len:
    953958            # Clean up the experiment name so that emulab will accept it.
    954959            ename = re.sub(vchars_re, '-', ename)
     
    958963            for i in range(0,5):
    959964                ename += random.choice(string.ascii_letters)
    960             self.log.warn("No experiment name: picked one randomly: %s" \
    961                     % ename)
     965            self.log.warn("No experiment name or suggestion too long: " + \
     966                    "picked one randomly: %s" % ename)
    962967
    963968        if not pubkey_base:
Note: See TracChangeset for help on using the changeset viewer.