move settings under uncloud.common
This commit is contained in:
parent
ef0f13534a
commit
6086fec633
19 changed files with 28 additions and 18 deletions
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
|
|
||||||
|
|
||||||
class Optional:
|
class Optional:
|
||||||
|
|
|
@ -4,7 +4,7 @@ import os
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'is_public': True,
|
'is_public': True,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import requests
|
||||||
from pyotp import TOTP
|
from pyotp import TOTP
|
||||||
|
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ from werkzeug.exceptions import HTTPException
|
||||||
from uncloud.common import counters
|
from uncloud.common import counters
|
||||||
from uncloud.common.vm import VMStatus
|
from uncloud.common.vm import VMStatus
|
||||||
from uncloud.common.request import RequestEntry, RequestType
|
from uncloud.common.request import RequestEntry, RequestType
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from . import schemas
|
from . import schemas
|
||||||
from .helper import generate_mac, mac2ipv6
|
from .helper import generate_mac, mac2ipv6
|
||||||
|
|
|
@ -22,7 +22,7 @@ import bitmath
|
||||||
from uncloud.common.host import HostStatus
|
from uncloud.common.host import HostStatus
|
||||||
from uncloud.common.vm import VMStatus
|
from uncloud.common.vm import VMStatus
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from . import helper, logger
|
from . import helper, logger
|
||||||
from .common_fields import Field, VmUUIDField
|
from .common_fields import Field, VmUUIDField
|
||||||
from .helper import check_otp, resolve_vm_name
|
from .helper import check_otp, resolve_vm_name
|
||||||
|
|
|
@ -5,7 +5,7 @@ import binascii
|
||||||
|
|
||||||
from pyotp import TOTP
|
from pyotp import TOTP
|
||||||
from os.path import join as join_path
|
from os.path import join as join_path
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
|
|
||||||
|
|
||||||
def get_otp_parser():
|
def get_otp_parser():
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
import random
|
import random
|
||||||
import logging
|
import logging
|
||||||
import socket
|
|
||||||
from contextlib import closing
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from abc import ABC
|
||||||
from . import logger
|
from . import logger
|
||||||
from os.path import join as join_path
|
from os.path import join as join_path
|
||||||
|
|
||||||
from uncloud.settings import settings as config
|
from uncloud.common.settings import settings as config
|
||||||
|
|
||||||
|
|
||||||
class ImageStorageHandler(ABC):
|
class ImageStorageHandler(ABC):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
|
|
||||||
arg_parser = argparse.ArgumentParser('configure', add_help=False)
|
arg_parser = argparse.ArgumentParser('configure', add_help=False)
|
||||||
|
|
12
uncloud/docs/README.md
Normal file
12
uncloud/docs/README.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# uncloud docs
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
1. Python3
|
||||||
|
2. Sphinx
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Run `make build` to build docs.
|
||||||
|
|
||||||
|
Run `make clean` to remove build directory.
|
||||||
|
|
||||||
|
Run `make publish` to push build dir to https://ungleich.ch/ucloud/
|
|
@ -9,7 +9,7 @@ import bitmath
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from . import logger
|
from . import logger
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ from uuid import uuid4
|
||||||
|
|
||||||
from uncloud.common.request import RequestEntry, RequestType
|
from uncloud.common.request import RequestEntry, RequestType
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.common.vm import VMStatus
|
from uncloud.common.vm import VMStatus
|
||||||
from uncloud.vmm import VMM
|
from uncloud.vmm import VMM
|
||||||
from os.path import join as join_path
|
from os.path import join as join_path
|
||||||
|
|
|
@ -17,7 +17,7 @@ from uncloud.common.network import create_dev, delete_network_interface
|
||||||
from uncloud.common.schemas import VMSchema, NetworkSchema
|
from uncloud.common.schemas import VMSchema, NetworkSchema
|
||||||
from uncloud.host import logger
|
from uncloud.host import logger
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.vmm import VMM
|
from uncloud.vmm import VMM
|
||||||
|
|
||||||
from marshmallow import ValidationError
|
from marshmallow import ValidationError
|
||||||
|
|
|
@ -4,7 +4,7 @@ import argparse
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
|
|
||||||
from os.path import join as join_path
|
from os.path import join as join_path
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.imagescanner import logger
|
from uncloud.imagescanner import logger
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ from flask import Flask, request
|
||||||
from flask_restful import Resource, Api
|
from flask_restful import Resource, Api
|
||||||
from werkzeug.exceptions import HTTPException
|
from werkzeug.exceptions import HTTPException
|
||||||
|
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
|
@ -7,7 +7,7 @@ from uncloud.common.host import HostStatus
|
||||||
from uncloud.common.request import RequestEntry, RequestType
|
from uncloud.common.request import RequestEntry, RequestType
|
||||||
from uncloud.common.vm import VMStatus
|
from uncloud.common.vm import VMStatus
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
|
|
||||||
|
|
||||||
def accumulated_specs(vms_specs):
|
def accumulated_specs(vms_specs):
|
||||||
|
|
|
@ -8,7 +8,7 @@ import argparse
|
||||||
|
|
||||||
from uncloud.common.request import RequestEntry, RequestType
|
from uncloud.common.request import RequestEntry, RequestType
|
||||||
from uncloud.shared import shared
|
from uncloud.shared import shared
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from .helper import (dead_host_mitigation, dead_host_detection, assign_host, NoSuitableHostFound)
|
from .helper import (dead_host_mitigation, dead_host_detection, assign_host, NoSuitableHostFound)
|
||||||
from . import logger
|
from . import logger
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from uncloud.settings import settings
|
from uncloud.common.settings import settings
|
||||||
from uncloud.common.vm import VmPool
|
from uncloud.common.vm import VmPool
|
||||||
from uncloud.common.host import HostPool
|
from uncloud.common.host import HostPool
|
||||||
from uncloud.common.request import RequestPool
|
from uncloud.common.request import RequestPool
|
||||||
|
|
Loading…
Reference in a new issue