Commit 8cddd645 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

Move to python3. initial

parent 6524a628
from builtins import object
from peewee import (Model, CharField, ForeignKeyField,
BooleanField)
class NodeType(Model):
class Meta:
class Meta(object):
db_table = "node_type"
name = CharField(max_length=64, unique=True)
......
from builtins import object
from peewee import (Model, CharField, ForeignKeyField,
BooleanField)
def migrate(migrator):
class NodeType(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "node_type"
......@@ -17,7 +18,7 @@ def migrate(migrator):
ansible_connection = CharField(max_length=255, default="smart")
class Node(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "node"
......
from builtins import object
from peewee import (Model, CharField, BooleanField)
def migrate(migrator):
class NodeType(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "node_type"
......
# Third-party modules
from builtins import str
from builtins import object
import yaml
from peewee import (Model, CharField, TextField, BooleanField)
......@@ -6,7 +8,7 @@ from peewee import (Model, CharField, TextField, BooleanField)
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......
from builtins import object
import os
import shutil
......@@ -6,7 +7,7 @@ from peewee import (Model, CharField, TextField, BooleanField)
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......
from __future__ import print_function
from builtins import object
import yaml
from peewee import (Model, CharField, TextField, BooleanField)
......@@ -6,7 +7,7 @@ from peewee import (Model, CharField, TextField, BooleanField)
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......
from builtins import object
from peewee import Model, CharField, TextField, ForeignKeyField, BooleanField
import os
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......@@ -18,7 +19,7 @@ def migrate(migrator):
)
class Role(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "role"
......
from builtins import object
from peewee import CharField, IntegerField, ForeignKeyField
from peewee import Model, TextField, BooleanField
import yaml
......@@ -57,7 +58,7 @@ DEFAULT_ROLES = [
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......@@ -65,7 +66,7 @@ def migrate(migrator):
service_config = TextField(default="")
class Role(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "role"
......@@ -77,7 +78,7 @@ def migrate(migrator):
role_name = CharField()
class Node(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "node"
......@@ -85,7 +86,7 @@ def migrate(migrator):
environment = ForeignKeyField(Environment, on_delete="RESTRICT")
class Pool(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "pool"
......@@ -93,7 +94,7 @@ def migrate(migrator):
name = CharField()
class Service(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "service"
......
from __future__ import print_function
from builtins import object
from peewee import Model, CharField, TextField, BooleanField
import yaml
import re
......@@ -13,7 +14,7 @@ def migrate(migrator):
)
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......
from __future__ import print_function
from builtins import object
from peewee import Model, CharField, ForeignKeyField, TextField, IntegerField
import yaml
import json
......@@ -6,7 +7,7 @@ import json
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......@@ -14,7 +15,7 @@ def migrate(migrator):
service_config = TextField(default="")
class Node(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "node"
......@@ -22,7 +23,7 @@ def migrate(migrator):
environment = ForeignKeyField(Environment, on_delete="RESTRICT")
class Pool(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "pool"
......@@ -30,7 +31,7 @@ def migrate(migrator):
name = CharField()
class Service(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "service"
......
from __future__ import print_function
from builtins import object
from peewee import Model, CharField, ForeignKeyField, TextField, IntegerField, BooleanField
import json
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......@@ -13,7 +14,7 @@ def migrate(migrator):
metrics_collector = CharField(default="")
class Node(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "node"
......@@ -21,7 +22,7 @@ def migrate(migrator):
environment = ForeignKeyField(Environment, on_delete="RESTRICT")
class Pool(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "pool"
......@@ -29,7 +30,7 @@ def migrate(migrator):
name = CharField()
class Service(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "service"
......
from builtins import object
from peewee import CharField, Model
def migrate(migrator):
class Environment(Model):
class Meta:
class Meta(object):
database = migrator.db
db_table = "environment"
......
......@@ -8,6 +8,8 @@
# Python modules
from __future__ import absolute_import
from builtins import str
from builtins import object
import logging
import os
......@@ -22,7 +24,7 @@ logger = logging.getLogger(__name__)
class Crashinfo(Model):
class Meta:
class Meta(object):
database = db
db_table = "crashinfo"
indexes = (
......
......@@ -8,6 +8,8 @@
# Third-party modules
from __future__ import absolute_import
from builtins import str
from builtins import object
from peewee import Model, CharField, TextField
# Tower modules
......@@ -15,7 +17,7 @@ from .db import db
class Datacenter(Model):
class Meta:
class Meta(object):
database = db
db_table = "datacenter"
......
......@@ -7,9 +7,13 @@
# ----------------------------------------------------------------------
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
import errno
import logging
from urlparse import urlparse
from urllib.parse import urlparse
# Python
import os
import subprocess
......@@ -31,7 +35,7 @@ logging.getLogger(__name__)
class Environment(Model):
class Meta:
class Meta(object):
database = db
db_table = "environment"
......@@ -295,7 +299,7 @@ class Environment(Model):
def name_config(config, service):
cfg = copy.deepcopy(config)
sv = service.replace("-", "_")
for k in cfg.keys():
for k in list(cfg.keys()):
cfg["_".join([sv, k])] = cfg.pop(k)
return cfg
......
......@@ -8,6 +8,7 @@
# Python modules
from __future__ import absolute_import
from builtins import object
import os
# Third-party modules
from peewee import (Model, CharField, TextField, ForeignKeyField,
......@@ -18,7 +19,7 @@ from .environment import Environment
class JobLog(Model):
class Meta:
class Meta(object):
database = db
db_table = "joblog"
......
......@@ -8,6 +8,7 @@
# Python modules
from __future__ import absolute_import
from builtins import object
import datetime
import logging
import os
......@@ -23,7 +24,7 @@ logger = logging.getLogger(__name__)
class Migration(Model):
class Meta:
class Meta(object):
database = db
db_table = "migration"
......
......@@ -8,6 +8,8 @@
# Third-party modules
from __future__ import absolute_import
from builtins import str
from builtins import object
from peewee import Model, CharField, TextField, ForeignKeyField, BooleanField
# Tower modules
from .db import db
......@@ -17,7 +19,7 @@ from .nodetype import NodeType
class Node(Model):
class Meta:
class Meta(object):
database = db
db_table = "node"
indexes = (
......
......@@ -8,6 +8,8 @@
# Third-party modules
from __future__ import absolute_import
from builtins import str
from builtins import object
from peewee import Model, CharField, BooleanField
# Tower modules
......@@ -15,7 +17,7 @@ from .db import db
class NodeType(Model):
class Meta:
class Meta(object):
database = db
db_table = "node_type"
......
......@@ -8,6 +8,8 @@
# Third-party modules
from __future__ import absolute_import
from builtins import str
from builtins import object
from peewee import CharField, TextField, ForeignKeyField
from playhouse.signals import Model, post_save
......@@ -19,7 +21,7 @@ DEFAULT_POOL = "default"
class Pool(Model):
class Meta:
class Meta(object):
database = db
db_table = "pool"
indexes = (
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment