Exemplo n.º 1
0
    def authenticate(self, adminUsername, adminPassword):
        """
        Check if the credentials are valid.

            Returns:
                True if username and password match a valid user in the system
            Throws:
                UserNotAuthorized
                TortugaException
        """

        url = 'v1/authenticate/%s' % (urllib.parse.quote_plus(adminUsername))

        postdata = json.dumps({
            'password': adminPassword,
        })

        try:
            _, responseDict = self.sendSessionRequest(url,
                                                      method='POST',
                                                      data=postdata)

            return toBool(responseDict.get('authenticate'))
        except TortugaException:
            raise
        except Exception as ex:
            raise TortugaException(exception=ex)
Exemplo n.º 2
0
 def setPreserve(self, preserve):
     """ Set preserve."""
     self['preserve'] = toBool(preserve)
Exemplo n.º 3
0
 def getIsRunning(self):
     return toBool(self.get('running'))
Exemplo n.º 4
0
 def setIsIdle(self, val):
     self['isIdle'] = toBool(val)
Exemplo n.º 5
0
 def setMcastEnabled(self, mcastEnabled):
     """ Set multicast enabled flag. """
     self['mcastEnabled'] = toBool(mcastEnabled)
Exemplo n.º 6
0
 def getSoftwareOverrideAllowed(self):
     """ Return hardware profile override allowed flag. """
     return toBool(self.get('softwareOverrideAllowed'))
Exemplo n.º 7
0
 def getGrow(self):
     return toBool(self.get('grow'))
Exemplo n.º 8
0
 def getBootLoader(self):
     """ Return boot loader flag. """
     return toBool(self.get('bootLoader'))
Exemplo n.º 9
0
 def getUsingDhcp(self):
     """ Get using dhcp flag. """
     return toBool(self.get('usingDhcp'))
Exemplo n.º 10
0
 def setUsingDhcp(self, usingDhcp):
     """ Set using dhcp flag. """
     self['usingDhcp'] = toBool(usingDhcp)
Exemplo n.º 11
0
 def getShared(self):
     return toBool(self.get('shared'))
Exemplo n.º 12
0
 def setShared(self, val):
     self['shared'] = toBool(val)
Exemplo n.º 13
0
 def getPersistent(self):
     return toBool(self.get('persistent'))
Exemplo n.º 14
0
 def setPersistent(self, val):
     self['persistent'] = toBool(val)
Exemplo n.º 15
0
 def getPreserve(self):
     """ Return preserve. """
     return toBool(self.get('preserve'))
Exemplo n.º 16
0
 def setBoot(self, boot):
     """ Set boot."""
     self['boot'] = toBool(boot)
Exemplo n.º 17
0
 def setBootLoader(self, bootLoader):
     """ Set boot loader flag."""
     self['bootLoader'] = toBool(bootLoader)
Exemplo n.º 18
0
 def getBoot(self):
     """ Return boot. """
     return toBool(self.get('boot'))
Exemplo n.º 19
0
 def setGrow(self, value=True):
     self['grow'] = toBool(value)
Exemplo n.º 20
0
Arquivo: kit.py Projeto: ilumb/tortuga
 def setIsOs(self, isOs):
     """ Set isOs flag."""
     self['isOs'] = toBool(isOs)
Exemplo n.º 21
0
 def setSoftwareOverrideAllowed(self, allowed):
     """ Set hardware profile override allowed flag."""
     self['softwareOverrideAllowed'] = toBool(allowed)
Exemplo n.º 22
0
Arquivo: kit.py Projeto: ilumb/tortuga
 def getIsOs(self):
     """ Return isOs flag. """
     return toBool(self.get('isOs'))
Exemplo n.º 23
0
 def setBcastEnabled(self, bcastEnabled):
     """ Set broadcast enabled flag. """
     self['bcastEnabled'] = toBool(bcastEnabled)
Exemplo n.º 24
0
Arquivo: kit.py Projeto: ilumb/tortuga
 def setIsRemovable(self, isRemovable):
     """ Set isRemovable flag."""
     self['isRemovable'] = toBool(isRemovable)
Exemplo n.º 25
0
 def getMcastEnabled(self):
     """ Return multicast enabled flag. """
     # The default for this flag is True...so if null set true..
     if self.get('mcastEnabled') is None:
         self.setMcastEnabled(True)
     return toBool(self.get('mcastEnabled'))
Exemplo n.º 26
0
Arquivo: kit.py Projeto: ilumb/tortuga
 def getIsRemovable(self):
     """ Return removable flag. """
     return toBool(self.get('isRemovable'))
Exemplo n.º 27
0
 def getIsIdle(self):
     return toBool(self.get('isIdle'))
Exemplo n.º 28
0
 def setIsRunning(self, val):
     self['running'] = toBool(val)