Did I find the right examples for you? yes no

All Samples(14)  |  Call(7)  |  Derive(0)  |  Import(7)

src/d/a/database-as-a-service-HEAD/dbaas/logical/models.py   database-as-a-service(Download)
from django_extensions.db.fields.encrypted import EncryptedCharField
from django.utils.functional import cached_property
from util import slugify, make_db_random_password
from util.models import BaseModel
from physical.models import DatabaseInfra, Environment, Plan
    def reset_password(self):
        """ Reset credential password to a new random password """
        self.password = make_db_random_password()
        self.driver.update_user(self)
        self.save()
        credential.user = user[:cls.USER_MAXIMUM_LENGTH_NAME]
        credential.user = slugify(credential.user)
        credential.password = make_db_random_password()
        credential.full_clean()
        credential.driver.create_user(credential)

src/d/a/database-as-a-service-HEAD/dbaas/logical/forms/credential.py   database-as-a-service(Download)
from django import forms
from ..models import Credential
from util import make_db_random_password
 
LOG = logging.getLogger(__name__)
        # if instance and instanceself.pk:
        # self.fields['password'].widget.attrs['readonly'] = True
        self.fields['password'].initial = make_db_random_password()
        self.fields['password'].required = False
        self.fields['password'].widget.attrs['readonly'] = True

src/d/a/database-as-a-service-HEAD/dbaas/integrations/iaas/pre_provisioned/pre_provisioned_provider.py   database-as-a-service(Download)
from ..base import BaseProvider
from physical.models import DatabaseInfra
from logical.models import Database, Credential
from util import make_db_random_password
import datetime
            if database.credentials.exists():
                for credential in database.credentials.all():
                    new_password = make_db_random_password()
                    new_credential = Credential.objects.get(pk=credential.id)
                    new_credential.password = new_password

src/d/a/database-as-a-service-HEAD/dbaas/drivers/mysqldb.py   database-as-a-service(Download)
from . import BaseDriver, DatabaseInfraStatus, AuthenticationError, ConnectionError, GenericDriverError, \
    DatabaseAlreadyExists, InvalidCredential, DatabaseStatus, DatabaseDoesNotExist, CredentialAlreadyExists
from util import make_db_random_password
from system.models import Configuration
 
    def change_default_pwd(self, instance):
        new_password = make_db_random_password()
        self.__query("SET PASSWORD FOR '%s'@'%%' = PASSWORD('%s')" %
                    (instance.databaseinfra.user, new_password))
        return new_password

src/d/a/database-as-a-service-HEAD/dbaas/drivers/mongodb.py   database-as-a-service(Download)
from . import BaseDriver, DatabaseInfraStatus, DatabaseStatus, \
    AuthenticationError, ConnectionError
from util import make_db_random_password
from system.models import Configuration
 
    def change_default_pwd(self, instance):
        with self.pymongo(instance=instance) as client:
            new_password = make_db_random_password()
            client.admin.add_user(name=instance.databaseinfra.user, password=new_password)
            return new_password

src/d/a/database-as-a-service-HEAD/dbaas/logical/forms/__init__.py   database-as-a-service(Download)
from ..models import Database, Credential, Project
from physical.models import Plan, Environment, DatabaseInfra, Engine
from util import make_db_random_password
 
from .database import DatabaseForm, CloneDatabaseForm

src/d/b/dbaas_cloudstack-0.0.9/dbaas_cloudstack/provider.py   dbaas_cloudstack(Download)
# -*- coding: utf-8 -*-
from client import CloudStackClient
from django.db import transaction
from physical.models import DatabaseInfra, Instance, Host
from util import make_db_random_password
            if database.credentials.exists():
                for credential in database.credentials.all():
                    new_password = make_db_random_password()
                    new_credential = Credential.objects.get(pk=credential.id)
                    new_credential.password = new_password