Rewriteing variables.

master3.3
Mike Hiretsky 13 years ago
parent e0a057778b
commit 9dca333c47

@ -33,7 +33,6 @@ from calculate.lib.utils.device import (detectDeviceForPartition,
getUdevDeviceInfo, countPartitions)
from calculate.lib.cl_vars_share import varsShare
from calculate.lib.cl_template import _terms
from calculate.lib.cl_fill import fillVars
import threading

@ -35,7 +35,7 @@ from calculate.lib.cl_fill import clLocale
from calculate.lib.cl_template import _terms
from calculate.install.cl_distr import (DistributiveRepository,
PartitionDistributive)
from calculate.install.cl_install import convertDictOpt
from calculate.install.cl_install import FileSystemManager
from operator import itemgetter
from calculate.lib.cl_lang import setLocalTranslate
@ -69,40 +69,6 @@ class fillVars(object, varsShare):
except:
pass
def get_ac_install_merge(self):
"""Need perform templates for install:merge or install:unmerge"""
actionsMap = {'merge':'up',
'system':'up'}
cl_action = self.Get('cl_action')
if cl_action == 'system' and \
self.Get('os_install_root_type') == 'flash':
return ""
return actionsMap[cl_action] if cl_action in actionsMap else ""
def get_ac_install_system(self):
"""Need perform templates for install:system"""
if self.Get('cl_action') == 'system' and \
self.Get('os_install_root_type') != "flash":
return "up"
else:
return ""
def get_ac_install_flash(self):
"""Need perform templates for install:flash"""
clAction = self.Get('cl_action')
if clAction == 'system' and self.Get('os_install_root_type') == 'flash':
return "up"
return ""
def get_ac_install_live(self):
"""Need perform templates for install:live"""
if self.Get('ac_install_merge') == "up" and \
self.Get('cl_chroot_status') == "off" or \
self.Get('cl_action') == 'live':
return "up"
else:
return ""
def get_os_install_net_hash(self):
"""Get net hash"""
rePci = re.compile(r"(\d\d:\d\d\.\d)(?:/[^/]+){2}$")
@ -1259,16 +1225,12 @@ class fillVars(object, varsShare):
def get_os_format_type(self):
"""Filesystem format support by calcualte-install"""
return filter(lambda x:not x in ("default","noformat") and
x in convertDictOpt._fileSystemOpt,
filter(lambda x:not x.startswith("_"),
convertDictOpt._fileSystemOpt.keys())+\
convertDictOpt._propertiesFileSystem.keys())
return FileSystemManager.supportFS.keys()
def get_os_format_use(self):
"""Avialable format by mkfs utility"""
return map(lambda x:"yes"
if path.exists(convertDictOpt._fileSystemOpt[x]["makefs"])
if path.exists(FileSystemManager.supportFS[x]["format"])
else "no", self.Get('os_format_type'))
def get_os_install_lang(self):

File diff suppressed because it is too large Load Diff

@ -19,422 +19,21 @@
# hide - flag, if it is True, then the variable is not printable
# printval - print value of variable
from cl_install import __version__, __app__
class Data:
# relative path for apply templates on files of system
cl_root_path = {}
from calculate.lib.cl_vars import Data as LibData
from calculate.lib.cl_datavars import Variables
from calculate.lib.variables import System, Net, Env, X11
from calculate.install.variables import (InstallAction, InstallLocale,
Distribute,InstallKernel,InstallX11,InstallNet,
InstallSystem,InstallLinux,InstallDisk)
class Data(InstallAction,InstallLocale,Distribute,InstallKernel,
InstallX11,InstallNet,InstallSystem,InstallLinux,
InstallDisk,LibData):
section = "install"
vars = ["cl_name","cl_ver"]
# program name
cl_name = {'value':__app__}
# program version
cl_ver = {'value':__version__}
"""
Action variable which has value "up" by default and not flash installation
"""
ac_install_merge = {}
"""
Action variable which has value "up" for installation on hdd
"""
ac_install_system = {}
"""
Action variable which has value "up" for USB flash
"""
ac_install_flash = {}
"""
Action which "up" value describe dinamic templates
"""
ac_install_live = {}
# install maching architecture
os_install_arch_machine = {'mode':'w'}
# inforamation about net interfaces
os_net_interfaces_info = {}
# infomation about disk in hash
os_device_hash = {'hide':True}
# infomation about disk in hash
os_disk_hash = {'hide':True}
# list of available partition devices
os_disk_dev = {}
# list mounted points for installed system
os_install_disk_mount = {}
# list mounted points for current operation system
os_disk_mount = {}
# partition content
os_disk_content = {}
# list filesystem for partition devices
os_disk_format = {}
# list type (lvm,raid,partition,disk)
os_disk_type = {}
# install list filesystem for partition devices
os_install_disk_format = {}
# need format
os_install_disk_perform_format = {}
# uudi for install
os_install_disk_uuid = {}
# /dev/sd or UUID= list (by cl_uuid_set)
os_install_disk_use = {}
cl_uuid_set = {'value':'on'}
# install partition's system id
os_install_disk_id = {}
# list uudi for partition devices
os_disk_uuid = {}
# partition's system id
os_disk_id = {}
# disk for boot mbr
os_install_mbr = {}
# list grub id for partition devices
os_disk_grub = {}
# install list grub id for partition devices (depend from mbr)
os_install_disk_grub = {}
# type of partition devices (primary, extended or logical)
os_disk_part = {}
# partition table on parent device
os_disk_table = {}
# partition size
os_disk_size = {}
# label of partitions
os_disk_name = {}
# list mount options
os_disk_options = {}
# devices
os_device_dev = {}
# device type (hdd,cdrom,usb-flash)
os_device_type = {}
# map number for grub
os_device_map = {}
# table for device
os_device_table = {}
# name of device
os_device_name = {}
# content of device.map file for grub
os_install_grub_devicemap_conf = {}
# information about mount points for fstab
os_install_fstab_mount_conf = {}
# information about swap for fstab
os_install_fstab_swap_conf = {}
# content of /etc/conf.d/net
#os_net_config_info = {}
# install scheduler
os_install_kernel_scheduler = {}
# install kernel attributes
os_install_kernel_attr = {}
# install kernel resume
os_install_kernel_resume = {}
# system image for installation
cl_image = {}
# path which contains images
cl_image_path = {}
# DISTFILES value
cl_distfiles_path = {'mode':'w',
'value':'/var/calculate/remote/distfiles'}
# PKGDIR value
cl_pkgdir_path = {'mode':'w'}
# LINGUAS value
os_install_linguas = {'mode':'w'}
# linux version of installation os
os_install_linux_ver = {'mode':'r'}
# linux build of installation os
os_install_linux_build = {'mode':'r'}
# subname of installation os
os_install_linux_subname = {'mode':'w'}
# shortname of installation os
os_install_linux_shortname = {'mode':'w'}
# name of installation os
os_install_linux_name = {'mode':'w'}
# installation os system: server or desktop
os_install_linux_system = {}
# root device of installed os
os_install_root_dev = {}
# root device of previous installed os
os_install_dev_from = {}
# list mount options of installed os
os_install_disk_options = {}
#
os_bind_hash = {'hide':True}
# directories for bind
os_bind_path = {}
# mountpoint for directories bind
os_bind_mountpoint = {}
os_install_bind_hash = {'hide':True}
# install directories for bind
os_install_bind_path = {}
# mountpoint for install directories bind
os_install_bind_mountpoint = {}
# busid of video card
hr_video_id = {'value':""}
# timezone for clock
os_install_clock_timezone = {'mode':'w'}
# type of clock (UTC or local)
os_install_clock_type = {'mode':'w'}
# xorg resolution
os_install_x11_resolution = {}
# fb resolution
os_install_fb_resolution = {'mode':'w'}
# makeconf makeopts
os_install_makeopts = {'mode':'w'}
# Video driver used by xorg
os_install_x11_video_drv = {'mode':'w'}
# on/off composite
os_install_x11_composite = {'mode':'w'}
# consolefont
os_install_locale_consolefont = {}
# keymap of locale (used for /etc/conf.d/keymaps)
os_install_locale_keymap = {}
# dumpkeys_charset for keymap
os_install_locale_dumpkeys = {}
# locale (at example: ru_RU.UTF-8)
os_install_locale_locale = {}
# full language (at example: ru_RU)
os_install_locale_lang = {}
# short language (at example ru)
os_install_locale_language = {}
# keyboard layout for X server
os_install_locale_xkb = {}
# keyboard layout name for X server
os_install_locale_xkbname = {}
# hash for information about net
os_install_net_hash = {}
# computer hostname
os_install_net_hostname = {'mode':"w"}
# allowed network
os_install_net_allow ={}
# net interfaces
os_install_net_interfaces={}
# net device name
os_install_net_name={}
# net devices mac
os_install_net_mac={}
# ip for all network interfaces
os_install_net_ip = {}
# network for ip
os_install_net_network = {}
# ip cidr
os_install_net_cidr = {}
# routing
os_install_net_route_hash = {}
# net for route
os_install_net_route_network = {}
# gw for route
os_install_net_route_gw = {}
# dev for route
os_install_net_route_dev = {}
# src for route
os_install_net_route_src = {}
# data by route for conf.d/net
os_install_net_route = {'hide':True}
# data by route for NetworkManager
os_install_net_nmroute = {'hide':True}
# dns servers
os_install_net_dns = {}
# net setup (networkmanager or openrc)
os_install_net_conf = {}
# net service configured
os_install_net_settings = {'mode':'w',
'value':''}
# dhcp or not
os_install_net_dhcp_set = {}
# dns search
os_install_net_dns_search = {'mode':"w"}
# domain
os_install_net_domain = {'mode':"w"}
# type of device for install
os_install_root_type = {'mode':'w'}
# using lvm
os_install_lvm_set = {}
# using mdadm
os_install_mdadm_set = {}
# proxy server for system
os_install_proxy = {'mode':'w',
'value':''}
# nt server for system
os_install_ntp = {'mode':'w',
'value':'ntp0.zenon.net'}
# kernel filename
os_install_kernel = {}
# optimized initramfs filename
os_install_initrd = {}
# install initramfs filename
os_install_initrd_install = {}
# install config kernel filename
os_install_kernel_config = {}
# install system map filename
os_install_system_map = {}
# install kernel uid
cl_install_kernel_uid = {}
# filesystem format support by calcualte-install
os_format_type = {}
# avialable format by mkfs utility
os_format_use = {}
# supported languages
os_install_lang = {}
# current grub
os_grub_conf = {}
# grub2 install path
os_grub2_path = {'mode':'w'}
# grub chroot need for grub-mkconfig
cl_chroot_grub = {}
# migrate users
cl_migrate_user = {}
# migrate users who need to change passwords
cl_migrate_user_pwd = {}
# install system in scratch mode
os_install_scratch = {}
# nvidia-drivers atom mask
os_nvidia_mask = {}
# (on or off) autoupdate config from install program
cl_autoupdate_set = {'value': "off"}
# (on or off) autoupdate config from install program for install
cl_install_autoupdate_set = {'mode':'w','value': "off"}
# variable for autologin
cl_autologin = {}
# lib vars
os_locale_xkb = {}
hr_video = {}
hr_video_name = {}
os_linux_name = {}
os_scratch = {}
os_x11_video_drv = {}
hr_cpu_num = {}
os_locale_locale = {}
os_net_interfaces = {}
cl_template_clt_path = {}
os_linux_ver = {}
os_net_allow = {}
cl_kernel_uid = {}
os_arch_machine = {}
cl_template_path = {}
os_net_hostname = {'mode':"w"}
cl_chroot_path = {'mode':"w"}
cl_env_path = {}
os_root_dev = {}
os_linux_shortname = {}
os_net_ip = {}
os_root_type = {}
hr_laptop = {}
hr_laptop_model = {}
os_locale_language = {}
cl_root_path = {'mode':"w"}

@ -15,13 +15,16 @@
# limitations under the License.
import soaplib, sys, time, os
import threading
from soaplib.serializers.primitive import String, Integer, Any, Boolean
from soaplib.serializers.clazz import Array, ClassSerializer
from soaplib.service import rpc, DefinitionBase
from cl_install import Install
import cl_install
from calculate.lib.cl_lang import setLocalTranslate
from calculate.api.server.decorators import Dec
setLocalTranslate('cl_install',sys.modules[__name__])
##########API########################
@ -48,10 +51,11 @@ class Field(ClassSerializer):
opt = Option
help = String
element = String
choice = Array(String)
choice = ChoiceValue
default = String
value = String
tablevalue = Table
listvalue = Array(String)
class GroupField(ClassSerializer):
name = String
@ -91,62 +95,55 @@ class InstallInfo(ClassSerializer):
timezone = String
default = Array(String)
class FieldError(ClassSerializer):
field = String
error = String
class ReturnedMessage(ClassSerializer):
"""type (error,warning,pid)"""
type = String
name = String
message = String
class Wsdl:
@rpc(String,Integer,InstallInfo,Boolean,_returns=Array(FieldError))
@rpc(Integer,InstallInfo,Boolean,_returns=Array(ReturnedMessage))
#@wsdl_server.check_permissions(["install"])
#@Basic.cache
#@Basic.console('cl-install')
#@Basic.gui('System.Install')
def install_system(self,cert,sid,param,onlycheck):
install = Install()
def install_system(self,sid,param,onlycheck):
reload(cl_install)
install = cl_install.Install()
install.initVars()
if onlycheck:
errors = []
for err in install.checkInstallParam(param.disks,
param.mbr,
param.type,
param.build):
errros.append(FieldError(field=err[0],
error=err[1]))
return errors
else:
install.installSystem(param.disks,param.mbr,param.type,param.build)
return []
def getPartitionInfo(self,clVars):
errors = []
for err in install.checkInstallParam(param.disk,
param.mbr,
param.type,
param.build):
errors.append(ReturnedMessage(
type="error",
name=err[0],
message=err[1]))
if not onlycheck and not errors:
install.installSystem(param.disk,param.mbr,param.type,param.build)
return errors
def getPartitionInfo(self,install):
MOUNTPOINT,DEVICE,MAKEFORMAT,FORMAT,LABLE,SIZE = 0,1,2,3,4,5
body = filter(lambda x:x[MOUNTPOINT],
clVars.zipVars('os_install_disk_mount',
'os_disk_dev',
'os_install_disk_perform_format',
'os_install_disk_format',
'os_disk_name',
'os_disk_size'))
table = Table(
head=[_("Mount point"),_("Partition"),
_("Perform format"),_("Filesystem"),
_("Label"),_("Size")],
body=body,
values=[])
table.values.append(ChoiceValue(
type="string"))
installTable = install.getCurrentPartitioning()
table = Table(head = installTable['head'],
body = installTable['body'],
values = [])
table.values.append(ChoiceValue(
values=clVars.Get('os_disk_dev'),
values=install.clVars.Get('os_disk_dev'),
comments = map(lambda x:"%s - %s - %s"%
(x[DEVICE],x[FORMAT],x[SIZE]),
body),
installTable['body']),
type="choice"))
table.values.append(ChoiceValue(
values=[_("yes"),_("no")],
type="string"))
table.values.append(ChoiceValue(
values=install.clVars.Get('os_format_type'),
type="choice"))
table.values.append(ChoiceValue(
values=clVars.Get('os_format_type'),
values=[_("yes"),_("no")],
type="choice"))
return table
@ -163,13 +160,15 @@ class Wsdl:
comments = [_("Hard disk"), _("USB Hard disk"),
_("USB Flash")])
@rpc(String,Integer,Integer,_returns=ViewInfo)
def install_system_view(self,cert,sid,page):
#print dir(wsdl_server)
@rpc(Integer,Integer,_returns=ViewInfo)
#@check_permissions('cl_install')
def install_system_view(self,sid,page):
threading.currentThread().lang = "ru"
view = ViewInfo(groups=[])
install = Install()
install.initVars()
if not page is None or page == 0:
if page is None or page == 0:
group = GroupField(name=_("Partitioning"),nextlabel=_("Next"))
group.fields = []
group.fields.append(Field(
@ -185,7 +184,7 @@ class Wsdl:
"creating bind mount point you have to specify the "
"source directory as DISK"),
element = "table",
tablevalue = self.getPartitionInfo(install.clVars)))
tablevalue = self.getPartitionInfo(install)))
group.fields.append(Field(
name = "mbr",
label = _("MBR"),
@ -196,6 +195,7 @@ class Wsdl:
_("boot disk for the system bound for install (for "
"recording MBR), off - disable MBR writing"),
element = "select",
listvalue = install.clVars.Get('os_install_mbr'),
choice = self.getDeviceChoice(install.clVars)))
group.fields.append(Field(
name = "type",
@ -206,10 +206,12 @@ class Wsdl:
help = \
_("device type for the system bound for install"),
element = "choice",
value = install.clVars.Get('os_install_root_type'),
choice = self.getDeviceTypesChoice()))
view.groups.append(group)
if not page is None or page == 1:
if page is None or page == 1:
group = GroupField(name=_("System"),last=True,nextlable=_("Install"))
group.fields = []
group.fields.append(Field(
name = "build",
label = _("Builder mode"),
@ -217,6 +219,7 @@ class Wsdl:
opt = Option(longopt="--build"),
help = \
_("installation for assemble"),
value = install.clVars.Get('os_install_scratch'),
element = "checkbox"))
view.groups.append(group)
return view

@ -0,0 +1,42 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.variables import X11
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallX11(X11):
vars = ["os_install_x11_resolution","os_install_x11_video_drv",
"os_install_x11_composite","os_install_fb_resolution","hr_video_id"]
# xorg resolution
os_install_x11_resolution = {}
# Video driver used by xorg
os_install_x11_video_drv = {'mode':'w'}
# on/off composite
os_install_x11_composite = {'mode':'w'}
# fb resolution
os_install_fb_resolution = {'mode':'w'}
# busid of video card
hr_video_id = {'value':""}

@ -0,0 +1,9 @@
from action import InstallAction
from disk import InstallDisk
from distr import Distribute
from kernel import InstallKernel
from linux import InstallLinux
from locale import InstallLocale
from net import InstallNet
from system import InstallSystem
from X11 import InstallX11

@ -0,0 +1,81 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallAction(Variables):
vars = ["ac_install_merge","ac_install_system","ac_install_flash",
"ac_install_live"]
"""
Action variable which has value "up" by default and not flash installation
"""
ac_install_merge = {}
"""
Action variable which has value "up" for installation on hdd
"""
ac_install_system = {}
"""
Action variable which has value "up" for USB flash
"""
ac_install_flash = {}
"""
Action which "up" value describe dinamic templates
"""
ac_install_live = {}
def get_ac_install_merge(self):
"""Need perform templates for install:merge or install:unmerge"""
actionsMap = {'merge':'up',
'system':'up'}
cl_action = self.Get('cl_action')
if cl_action == 'system' and \
self.Get('os_install_root_type') == 'flash':
return ""
return actionsMap.get(cl_action,'')
def get_ac_install_system(self):
"""Need perform templates for install:system"""
if self.Get('cl_action') == 'system' and \
self.Get('os_install_root_type') != "flash":
return "up"
else:
return ""
def get_ac_install_flash(self):
"""Need perform templates for install:flash"""
clAction = self.Get('cl_action')
if clAction == 'system' and self.Get('os_install_root_type') == 'flash':
return "up"
return ""
def get_ac_install_live(self):
"""Need perform templates for install:live"""
if self.Get('ac_install_merge') == "up" and \
self.Get('cl_chroot_status') == "off" or \
self.Get('cl_action') == 'live':
return "up"
else:
return ""

@ -0,0 +1,148 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallDisk(Variables):
vars = ["os_device_hash","os_disk_hash","os_disk_dev",
"os_install_disk_mount","os_disk_mount","os_disk_content",
"os_disk_format","os_disk_type","os_install_disk_format",
"os_install_disk_perform_format","os_install_disk_uuid",
"os_install_disk_use","cl_uuid_set","os_install_disk_id",
"os_disk_uuid","os_disk_id","os_install_mbr","os_disk_grub",
"os_install_disk_grub","os_disk_part","os_disk_table",
"os_disk_size","os_disk_name","os_disk_options","os_device_dev",
"os_device_type","os_device_map","os_device_table","os_device_name",
"os_install_disk_options","os_bind_hash","os_bind_path","os_bind_mountpoint",
"os_install_bind_hash","os_install_bind_path","os_install_bind_mountpoint",
"os_install_fstab_mount_conf","os_install_fstab_swap_conf"]
# infomation about disk in hash
os_device_hash = {'hide':True}
# infomation about disk in hash
os_disk_hash = {'hide':True}
# list of available partition devices
os_disk_dev = {}
# list mounted points for installed system
os_install_disk_mount = {}
# list mounted points for current operation system
os_disk_mount = {}
# partition content
os_disk_content = {}
# list filesystem for partition devices
os_disk_format = {}
# list type (lvm,raid,partition,disk)
os_disk_type = {}
# install list filesystem for partition devices
os_install_disk_format = {}
# need format
os_install_disk_perform_format = {}
# uudi for install
os_install_disk_uuid = {}
# /dev/sd or UUID= list (by cl_uuid_set)
os_install_disk_use = {}
cl_uuid_set = {'value':'on'}
# install partition's system id
os_install_disk_id = {}
# list uudi for partition devices
os_disk_uuid = {}
# partition's system id
os_disk_id = {}
# disk for boot mbr
os_install_mbr = {}
# list grub id for partition devices
os_disk_grub = {}
# install list grub id for partition devices (depend from mbr)
os_install_disk_grub = {}
# type of partition devices (primary, extended or logical)
os_disk_part = {}
# partition table on parent device
os_disk_table = {}
# partition size
os_disk_size = {}
# label of partitions
os_disk_name = {}
# list mount options
os_disk_options = {}
# devices
os_device_dev = {}
# device type (hdd,cdrom,usb-flash)
os_device_type = {}
# map number for grub
os_device_map = {}
# table for device
os_device_table = {}
# name of device
os_device_name = {}
# list mount options of installed os
os_install_disk_options = {}
os_bind_hash = {'hide':True}
# directories for bind
os_bind_path = {}
# mountpoint for directories bind
os_bind_mountpoint = {}
os_install_bind_hash = {'hide':True}
# install directories for bind
os_install_bind_path = {}
# mountpoint for install directories bind
os_install_bind_mountpoint = {}
# information about mount points for fstab
os_install_fstab_mount_conf = {}
# information about swap for fstab
os_install_fstab_swap_conf = {}

@ -0,0 +1,32 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class Distribute(Variables):
vars = ["cl_image","cl_image_path"]
# system image for installation
cl_image = {}
# path which contains images
cl_image_path = {}

@ -0,0 +1,56 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallKernel(Variables):
vars = ["os_install_kernel_scheduler","os_install_kernel_attr",
"os_install_kernel_resume","os_install_kernel","os_install_initrd",
"os_install_initrd_install","os_install_kernel_config",
"os_install_system_map","cl_install_kernel_uid"]
# install scheduler
os_install_kernel_scheduler = {}
# install kernel attributes
os_install_kernel_attr = {}
# install kernel resume
os_install_kernel_resume = {}
# kernel filename
os_install_kernel = {}
# optimized initramfs filename
os_install_initrd = {}
# install initramfs filename
os_install_initrd_install = {}
# install config kernel filename
os_install_kernel_config = {}
# install system map filename
os_install_system_map = {}
# install kernel uid
cl_install_kernel_uid = {}

@ -0,0 +1,47 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.variables import Linux
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallLinux(Linux):
vars = ["os_install_linux_ver","os_install_linux_build",
"os_install_linux_subname","os_install_linux_shortname",
"os_install_linux_name","os_install_linux_system"]
# linux version of installation os
os_install_linux_ver = {'mode':'r'}
# linux build of installation os
os_install_linux_build = {'mode':'r'}
# subname of installation os
os_install_linux_subname = {'mode':'w'}
# shortname of installation os
os_install_linux_shortname = {'mode':'w'}
# name of installation os
os_install_linux_name = {'mode':'w'}
# installation os system: server or desktop
os_install_linux_system = {}

@ -0,0 +1,69 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.variables import Locale
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallLocale(Locale):
vars = ["os_install_linguas", "os_install_locale_consolefont",
"os_install_locale_keymap", "os_install_locale_dumpkeys",
"os_install_locale_locale", "os_install_locale_lang",
"os_install_locale_language", "os_install_locale_xkb",
"os_install_locale_xkbname", "os_install_clock_timezone",
"os_install_clock_type", "os_install_lang"]
# LINGUAS value
os_install_linguas = {'mode':'w'}
# consolefont
os_install_locale_consolefont = {}
# keymap of locale (used for /etc/conf.d/keymaps)
os_install_locale_keymap = {}
# dumpkeys_charset for keymap
os_install_locale_dumpkeys = {}
# locale (at example: ru_RU.UTF-8)
os_install_locale_locale = {}
# full language (at example: ru_RU)
os_install_locale_lang = {}
# short language (at example ru)
os_install_locale_language = {}
# keyboard layout for X server
os_install_locale_xkb = {}
# keyboard layout name for X server
os_install_locale_xkbname = {}
# timezone for clock
os_install_clock_timezone = {'mode':'w'}
# type of clock (UTC or local)
os_install_clock_type = {'mode':'w'}
# supported languages
os_install_lang = {}

@ -0,0 +1,107 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.variables import Net
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallNet(Net):
vars = ["os_net_interfaces_info","os_install_net_hash",
"os_install_net_hostname","os_install_net_allow",
"os_install_net_interfaces","os_install_net_name",
"os_install_net_mac","os_install_net_ip","os_install_net_network",
"os_install_net_cidr","os_install_net_route_hash",
"os_install_net_route_network","os_install_net_route_gw",
"os_install_net_route_dev","os_install_net_route_src",
"os_install_net_route","os_install_net_nmroute",
"os_install_net_dns","os_install_net_conf",
"os_install_net_settings","os_install_net_dhcp_set",
"os_install_net_dns_search","os_install_net_domain"]
# inforamation about net interfaces
os_net_interfaces_info = {}
# hash for information about net
os_install_net_hash = {}
# computer hostname
os_install_net_hostname = {'mode':"w"}
# allowed network
os_install_net_allow ={}
# net interfaces
os_install_net_interfaces={}
# net device name
os_install_net_name={}
# net devices mac
os_install_net_mac={}
# ip for all network interfaces
os_install_net_ip = {}
# network for ip
os_install_net_network = {}
# ip cidr
os_install_net_cidr = {}
# routing
os_install_net_route_hash = {}
# net for route
os_install_net_route_network = {}
# gw for route
os_install_net_route_gw = {}
# dev for route
os_install_net_route_dev = {}
# src for route
os_install_net_route_src = {}
# data by route for conf.d/net
os_install_net_route = {'hide':True}
# data by route for NetworkManager
os_install_net_nmroute = {'hide':True}
# dns servers
os_install_net_dns = {}
# net setup (networkmanager or openrc)
os_install_net_conf = {}
# net service configured
os_install_net_settings = {'mode':'w',
'value':''}
# dhcp or not
os_install_net_dhcp_set = {}
# dns search
os_install_net_dns_search = {'mode':"w"}
# domain
os_install_net_domain = {'mode':"w"}

@ -0,0 +1,108 @@
#-*- coding: utf-8 -*-
# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.cl_datavars import Variables
from calculate.lib.variables import System
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__])
class InstallSystem(System):
vars = ["os_install_scratch","cl_autoupdate_set",
"cl_install_autoupdate_set","os_install_arch_machine",
"os_install_proxy","os_install_ntp","os_install_root_type",
"os_install_root_dev","os_install_dev_from","os_install_lvm_set",
"os_install_mdadm_set","os_grub_conf","os_grub2_path",
"cl_chroot_grub","os_install_grub_devicemap_conf",
"cl_distfiles_path","cl_pkgdir_path","os_format_type",
"os_format_use","os_install_makeopts","cl_migrate_user",
"cl_migrate_user_pwd","os_nvidia_mask","cl_autologin"]
# install system in scratch mode
os_install_scratch = {}
# (on or off) autoupdate config from install program
cl_autoupdate_set = {'value': "off"}
# (on or off) autoupdate config from install program for install
cl_install_autoupdate_set = {'mode':'w','value': "off"}
# install maching architecture
os_install_arch_machine = {'mode':'w'}
# proxy server for system
os_install_proxy = {'mode':'w',
'value':''}
# nt server for system
os_install_ntp = {'mode':'w',
'value':'ntp0.zenon.net'}
# type of device for install
os_install_root_type = {'mode':'w'}
# root device of installed os
os_install_root_dev = {}
# root device of previous installed os
os_install_dev_from = {}
# using lvm
os_install_lvm_set = {}
# using mdadm
os_install_mdadm_set = {}
# current grub
os_grub_conf = {}
# grub2 install path
os_grub2_path = {'mode':'w'}
# grub chroot need for grub-mkconfig
cl_chroot_grub = {}
# content of device.map file for grub
os_install_grub_devicemap_conf = {}
# DISTFILES value
cl_distfiles_path = {'mode':'w',
'value':'/var/calculate/remote/distfiles'}
# PKGDIR value
cl_pkgdir_path = {'mode':'w'}
# filesystem format support by calcualte-install
os_format_type = {}
# avialable format by mkfs utility
os_format_use = {}
# makeconf makeopts
os_install_makeopts = {'mode':'w'}
# migrate users
cl_migrate_user = {}
# migrate users who need to change passwords
cl_migrate_user_pwd = {}
# nvidia-drivers atom mask
os_nvidia_mask = {}
# variable for autologin
cl_autologin = {}

@ -1,88 +0,0 @@
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import os
sys.path.insert(0,os.path.abspath('/usr/lib/calculate-2.2/calculate-lib/pym'))
sys.path.insert(0,
os.path.abspath('/usr/lib/calculate-2.2/calculate-install/pym'))
from cl_lang import lang
tr = lang()
tr.setGlobalDomain('cl_install')
tr.setLanguage(sys.modules[__name__])
from cl_install_cmd import install_cmd
if __name__ == "__main__":
install = install_cmd()
install.logicObj.initVars()
# set lang
ret = install.optobj.parse_args()
if ret is False:
sys.exit(1)
options, args = ret
# set color/nocolor for display messages
install.setPrintNoColor(options)
# init variables
install.setProxyNtpHostname(options.proxy,options.ntp,options.hostname)
if not install.setNetworkParams(options.ip,options.route,options.dns,
options.netconf,options.dhcp):
sys.exit(1)
if options.l:
if not install.setLang(options.l):
sys.exit(1)
# set values to variables
if not install.setVars(options):
sys.exit(1)
# check and set installed options
install.setAction(options.startup,options.live)
if not (options.startup or options.install or options.uninstall or
options.live):
if not install.checkAndSetInstallOptions(options.d,options.w,
options.u,options.A):
sys.exit(1)
# print variables
if options.v or options.filter or options.xml:
install.printVars(options)
sys.exit(0)
if options.p:
install.showPartitions()
sys.exit(0)
# check root
if not install.isRoot():
sys.exit(1)
# configurate current system
if options.startup:
if not install.configureSystem(options.A):
sys.exit(1)
elif options.install:
if not install.installPackage():
sys.exit(1)
elif options.uninstall:
if not install.uninstallPackage():
sys.exit(1)
else:
forceOpions = options.f or options.P
flagSpinner = not options.nospinner
if not install.installSystem(force=forceOpions, bootDisk=options.mbr,
stdinReadPwd=options.P,builder=options.build,
flagSpinner=flagSpinner,update=options.U):
sys.exit(1)
#if not install.writeVars(options):
# sys.exit(1)
sys.exit(0)

@ -0,0 +1,372 @@
#!/usr/bin/python
#-*- coding: utf-8 -*-
# Copyright 2012 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from suds.client import Client
from suds import WebFault
import traceback as tb
from getpass import getpass
import time, logging
import glob, os
from OpenSSL.crypto import load_certificate, FILETYPE_PEM
import re, threading
from calculate.api.client.function import *
from calculate.api.client.pid_information import *
from calculate.api.client.cert_func import *
from calculate.api.client.sid_func import *
from calculate.lib.cl_datavars import DataVars
from calculate.api.client.client_class import HTTPSClientAuthHandler, HTTPSClientCertTransport
VERSION = 0.1
class Client_suds(Client):
def set_parameters (self, path_to_cert):
self.CERT_FILE = path_to_cert + 'client.crt'
self.CERT_PEM = path_to_cert + 'client.pem'
self.REQ_FILE = path_to_cert + 'client.csr'
self.PKEY_FILE = path_to_cert + 'client.key'
self.SID_FILE = path_to_cert + 'sid.int'
t = time
help_ = '''
useradd, cl-unix-useradd - add unix user
say, say_hello - server function
halt, server_shutdown - shutdown server
run, server_start - start server
---- process methods ----
lsp, list-pid - listing all pids for this session
pi, pid-info - get information about select pid (0 for all)
kill, pid-kill - kill select pid
---- sessions methods ----
lss, list-session - listing all sessions in server
si, session-info - get information about select session (sid)
lsr, list-method - listing all accessible methods
q, quit - exit
h, help - display this help and exit
v, version - output version information and exit'''
#class NewType:
#def __init__ (self, a, b):
#self.a = int(a)
#self.b = str(b)
def client_say_hello(client):
#try:
name2 = raw_input ("Enter your name: ")
times = raw_input ("Enter number repeating (1-100): ")
if (not name2.isalpha()):
print "Name input Error!"
return 2
try:
times = int(times)
except:
print "Number repeating input Error!"
return 2
if times < 1 or times > 100:
print "Number repeating must be > 0 and < 100"
return 2
#get cert & sid
#try:
c_s = get_cert_sid(client.CERT_FILE, client.SID_FILE)
#name = client.factory.create('s1:NewType')
#name4 = client.factory.create('s1:UserInfoValue')
#name.helper = 4
#name4.table.name = name2
#name4.table.surname = "fadf"
#name.value = name4
#a = 3
name = client.factory.create('s0:stringArray')
name['string'] = [name2,"BBBBBBB"]
s = client.service.say_hello(c_s[0], c_s[1], name, times)
#print s.helper
#print dir (s.value)
#print s.value.data.name
#except:
#print "Connection error! "
#return 1
try:
if s[1][0] == "Permission denied":
print s[1][0], s[1][1]
return 3
except:
return 0
def client_login (client):
login = raw_input ("Login: ")
password = raw_input ("password: ")
try:
name_re = re.compile("[^a-zA-Z_]")
if name_re.findall(login):
print "input error"
return 2
param = ""
print login, password
print client.service.cl_login(login = login, password = password)
except:
print "create error"
def client_useradd (client):
user_name = raw_input ("User name: ")
try:
name_re = re.compile("[^a-zA-Z_]")
if name_re.findall(user_name):
print "input error"
return 2
param = ""
print client.service.cl_unix_useradd(param = user_name)
except:
print "create error"
def client_userdel (client):
user_name = raw_input ("User name: ")
try:
name_re = re.compile("[^a-zA-Z_]")
if name_re.findall(user_name):
print "input error"
return 2
param = ""
print client.service.cl_unix_userdel(param = user_name)
except:
print "deleted error"
def client_shut (client):
import soaplib
try:
temp = client.service.server_shutdown()
if ( temp == 1):
print "Server shutting down..."
except:
print "Connection error! "
return 1
def client_signal(client):
while True:
time.sleep(5)
if os.path.exists(client.SID_FILE) :
fi = open(client.SID_FILE, 'r')
temp = fi.read()
fi.close()
sid = int(temp)
else:
sid = 0
reply = client.service.active_client(sid)
import argparse
def parse():
parser = argparse.ArgumentParser()
parser.add_argument(
'-p', '--port', type=int, default = '8888', dest='port',
help='port number')
parser.add_argument(
'--script', type=str, default = '/Server', dest='script_name',
help='name script in server')
parser.add_argument(
'--host', type=str, default = 'localhost', dest='host',
help='host destination')
parser.add_argument(
'--cert-path', type=str,
default = '~/.calculate/client_cert/',
nargs ='?', dest='path_to_cert',
help='path to cert and key file')
return parser.parse_args()
#url = 'http://localhost:8888/TestService/?wsdl'
def https_server(client, signaling):
global url
client_post_auth(client)
signaling.start()
client_list_methods(client)
sid = get_sid(client.SID_FILE)[1]
print client.service.install_system_view(sid ,0)
installInfo = create_obj(client,"install_system")
for params in [
# ("cl-install -d /dev/sda3:/:reiserfs:format -d /dev/sda5:/var/calculate:ext4:noformat",
# listToArrayArray(client,
# [["/dev/sda3","/","reiserfs","format"],
# ["/dev/sda5","/var/calculate","ext4","noformat"]])),
# ("cl-install -d /dev/sda3:swap -d /dev/sda5:/var/calculate:ext4:noformat",
# listToArrayArray(client,
# [["/dev/sda3","swap"],
# ["/dev/sda5","/var/calculate","ext4","noformat"]])),
# ("cl-install -d /var/calculate/home:/home -d /dev/sda5:/var/calculate:ext4:noformat",
# listToArrayArray(client,
# [["/var/calculate/home","/home"],
# ["/dev/sda5","/var/calculate","ext4","noformat"]])),
# ("cl-install -d /dev/sda10:/ -d /var/calculate/home:/home -d /dev/sda5:/var/calculate:ext4:noformat",
# listToArrayArray(client,
# [["/dev/sda10","/"],
# ["/var/calculate/home","/home"],
# ["/dev/sda5","/var/calculate","ext4","noformat"]])),
# ("cl-install -d /dev/sda4:/ -d /var/calculate/home:/home -d /dev/sda5:/var/calculate:ext4:noformat",
# listToArrayArray(client,
# [["/dev/sda4","/"],
# ["/var/calculate/home","/home"],
# ["/dev/sda5","/var/calculate","ext4","noformat"]])),
# ("cl-install -d /dev/sr0:/ -d /var/calculate/home:/home -d /dev/sda5:/var/calculate:ext4:noformat",
# listToArrayArray(client,
# [["/dev/sr0","/"],
# ["/var/calculate/home","/home"],
# ["/dev/sda5","/var/calculate","ext4","noformat"]])),
# ("cl-install -d /var/calculate/home:/home -d /home:/test",
# listToArrayArray(client,
# [["/var/calculate/home","/home"],
# ["/home","/test"]])),
# ("cl-install -d var/calculate/home:/home -d /home2:test",
# listToArrayArray(client,
# [["var/calculate/home","/home"],
# ["/home2","test"]])),
# ("cl-install -d /dev/sda2:/ -d /dev/sda2:/var/calculate",
# listToArrayArray(client,
# [["/dev/sda2","/"],
# ["/dev/sda2","/var/calculate"]])),
# ("cl-install -d /dev/sda2:/ -d /dev/sda2:/var/calculate",
# listToArrayArray(client,
# [["/dev/sda2","/"],
# ["/dev/sda3","/"]])),
# ("cl-install -d /dev/sda2:/ -d /dev/sda5:/var/calculate",
# listToArrayArray(client,
# [["/dev/sda2","/"],
# ["/dev/sda5","/var/calculate"]])),
# ("cl-install -d /dev/sda3:/:vfat -d /dev/sda5:/var/calculate",
# listToArrayArray(client,
# [["/dev/sda3","/","vfat"],
# ["/dev/sda5","/var/calculate"]])),
# ("cl-install -d /dev/sda3:/:ntfs -d /dev/sda2:/var/calculate:ext3",
# listToArrayArray(client,
# [["/dev/sda3","/","ntfs"],
# ["/dev/sda2","/var/calculate","ext3"]])),
# ("cl-install -d /dev/sda3:/:flaksjdf -d /dev/sda5:/var/calculate",
# listToArrayArray(client,
# [["/dev/sda3","/","flaksjdf"],
# ["/dev/sda5","/var/calculate"]])),
("cl-install -d /dev/sda3:/ -d /dev/sda5:/var/calculate",
listToArrayArray(client,
[["/dev/sda3","/"],
["/dev/sda5","/var/calculate"]]),
listToArray(client,["falksdjflkasd"])),
("cl-install -d /dev/sda3:/:flaksjdf -d /dev/sda5:/var/calculate",
listToArrayArray(client,
[["/dev/sda3","/","flaksjdf"],
["/dev/sda5","/var/calculate"]]),
listToArray(client,["/dev/sda"])),
]:
print params[0]
installInfo.disk = params[1]
if len(params) > 2:
installInfo.mbr = params[2]
errs = client.service.install_system(sid,installInfo,True)
if errs:
for err in errs[0]:
print "Wrong value for '%s':%s"%(err.name,err.message)
def main():
clear()
#password = getpass(prompt="Password: ")
logging.basicConfig(level=logging.FATAL)
logging.getLogger('suds.client').setLevel(logging.FATAL)
logging.getLogger('suds.transport').setLevel(logging.FATAL)
logging.getLogger('suds.transport.http').setLevel(logging.FATAL)
#fmt = '%(asctime)s [%(levelname)s] %(funcName)s() @%(filename)s:%(lineno)d\n%(message)s\n'
#logging.basicConfig(level=logging.INFO, format=fmt)
logging.getLogger('suds.umx.typed').setLevel(logging.ERROR)
clVars = DataVars()
clVars.flIniFile()
homePath = clVars.Get('ur_home_path')
args = parse()
port = args.port
host = args.host
path_to_cert = args.path_to_cert
path_to_cert = path_to_cert.replace("~",homePath)
script_name = args.script_name
print "wsdl is at: https://%s:%d%s/?wsdl" %(host, port, script_name)
url = "https://%s:%d%s/?wsdl" %(host, port, script_name)
try:
# client_start()
CERT_FILE = path_to_cert + 'client.crt'
CERT_PEM = path_to_cert + 'client.pem'
CERT_KEY = path_to_cert + 'client.key'
#If the certificate file is created
if os.path.exists(CERT_KEY) and \
os.path.exists(CERT_FILE):
client = Client_suds(url,\
transport = HTTPSClientCertTransport(CERT_KEY, CERT_FILE,\
path_to_cert))
#If the certificate file misses
else:
CERT_FILE = None
CERT_KEY = None
CERT_PEM = None
client = Client_suds(url,\
transport = HTTPSClientCertTransport(CERT_KEY, CERT_FILE,\
path_to_cert))
#print CERT_PEM
#print "#######################################"
#print dir (client)
#print "#######################################"
#threads = []
client.set_parameters (path_to_cert.replace("~",homePath))
signaling = threading.Thread(target=client_signal, args = (client, ))
#threads.append(signaling)
signaling.setDaemon(True)
https_server(client, signaling)
#----------------------------------------------------
except WebFault, f:
print f
print f.fault
except Exception, e:
#signaling.killed = True
print e
tb.print_exc()
if __name__=='__main__':
main()

@ -174,9 +174,9 @@ setup(
url = "http://calculate-linux.org",
license = "http://www.apache.org/licenses/LICENSE-2.0",
package_dir = {'calculate.install': "install"},
packages = ['calculate.install'],
packages = ['calculate.install','calculate.install.variables'],
data_files = data_files,
scripts=[],
scripts=['scripts/cl-install3'],
cmdclass={'install_data': cl_install_data,
'build':build,'build_man':build_man,
'install':install,'install_man':install_man},

Loading…
Cancel
Save