Commit 393cf091 authored by Boxiang Sun's avatar Boxiang Sun

software/turnserver: move to python3

parent 4371e39c
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
# #
############################################################################## ##############################################################################
import ConfigParser try:
from ConfigParser import ConfigParser, NoSectionError
except ImportError:
from configparser import ConfigParser, NoSectionError
import os import os
import zc.buildout import zc.buildout
...@@ -53,7 +56,7 @@ class WriteRecipe(GenericBaseRecipe): ...@@ -53,7 +56,7 @@ class WriteRecipe(GenericBaseRecipe):
def install(self): def install(self):
# Set up the parser, and write config file if needed # Set up the parser, and write config file if needed
self.parser = ConfigParser.ConfigParser() self.parser = ConfigParser()
try: try:
self.parser.read(self.path) self.parser.read(self.path)
#clean_options(options) #clean_options(options)
...@@ -63,7 +66,7 @@ class WriteRecipe(GenericBaseRecipe): ...@@ -63,7 +66,7 @@ class WriteRecipe(GenericBaseRecipe):
with open(self.path, 'w') as file: with open(self.path, 'w') as file:
self.parser.write(file) self.parser.write(file)
# If the file or section do not exist # If the file or section do not exist
except (ConfigParser.NoSectionError, IOError) as e: except (NoSectionError, IOError) as e:
self.full_install() self.full_install()
def full_install(self): def full_install(self):
...@@ -94,7 +97,7 @@ class ReadRecipe(GenericBaseRecipe): ...@@ -94,7 +97,7 @@ class ReadRecipe(GenericBaseRecipe):
self.path = options['file-path'].strip() self.path = options['file-path'].strip()
# Set up the parser, and write config file if needed # Set up the parser, and write config file if needed
self.parser = ConfigParser.ConfigParser() self.parser = ConfigParser()
if os.path.exists(self.path): if os.path.exists(self.path):
self.parser.read(self.path) self.parser.read(self.path)
for section in self.parser.sections(): for section in self.parser.sections():
......
...@@ -18,3 +18,4 @@ extra = ...@@ -18,3 +18,4 @@ extra =
powerdns ${slapos.test.powerdns-setup:setup} powerdns ${slapos.test.powerdns-setup:setup}
proftpd ${slapos.test.proftpd-setup:setup} proftpd ${slapos.test.proftpd-setup:setup}
repman ${slapos.test.repman-setup:setup} repman ${slapos.test.repman-setup:setup}
turnserver ${slapos.test.turnserver-setup:setup}
...@@ -197,7 +197,6 @@ eggs += ...@@ -197,7 +197,6 @@ eggs +=
${slapos.test.slaprunner-setup:egg} ${slapos.test.slaprunner-setup:egg}
${slapos.test.jupyter-setup:egg} ${slapos.test.jupyter-setup:egg}
${slapos.test.nextcloud-setup:egg} ${slapos.test.nextcloud-setup:egg}
${slapos.test.turnserver-setup:egg}
${slapos.test.theia-setup:egg} ${slapos.test.theia-setup:egg}
${slapos.test.cloudooo-setup:egg} ${slapos.test.cloudooo-setup:egg}
${slapos.test.dream-setup:egg} ${slapos.test.dream-setup:egg}
......
...@@ -14,6 +14,8 @@ parts = ...@@ -14,6 +14,8 @@ parts =
coturn coturn
instance-cfg instance-cfg
[python]
part = python3
[download-base] [download-base]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
......
Markdown is supported
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