gabriel 6 rokov pred
rodič
commit
b7ea83d41a

+ 13 - 1
Dockerfile

@@ -15,7 +15,10 @@ ADD bin/* /usr/bin/
 
 WORKDIR /opt
 
-RUN echo Acquire::http::Proxy "http://aptcache.infra.flowdat.com/"; > /etc/apt/apt.conf.d/00aptproxy; \
+RUN chmod 0600 /opt/keys/*; \
+    eval $(ssh-agent); \
+    ssh-add /opt/keys/bitbucket.id_rsa; \
+    echo Acquire::http::Proxy "http://aptcache.infra.flowdat.com/"; > /etc/apt/apt.conf.d/00aptproxy; \
     apt-get update; \
     apt-get install -yq parallel lockfile-progs expect telnet sudo cron patch \
                         openssh-server gdal-bin; \
@@ -36,6 +39,15 @@ RUN echo Acquire::http::Proxy "http://aptcache.infra.flowdat.com/"; > /etc/apt/a
     touch /var/log/cron.log; \
     touch /var/log/cron.err.log; \
     touch /var/log/cron.out.log; \
+    git clone git@gitlab.com:interlink-sa/flowdat3/modules/stats.git /opt/stats; \
+    cd /opt/stats; \
+    cp app/config/parameters.yml.dist app/config/parameters.yml ;\
+    cp app/config/bundles/hwi/oauth-bundle/parameters.yml.dist app/config/bundles/hwi/oauth-bundle/parameters.yml ;\
+    cp app/config/bundles/ik/webservice-bundle/parameters.yml.dist app/config/bundles/ik/webservice-bundle/parameters.yml ;\
+    cp app/config/bundles/ik/base-admin-bundle/parameters.yml.dist app/config/bundles/ik/base-admin-bundle/parameters.yml; \
+    cp app/config/bundles/ik/audit-bundle/parameters.yml.dist ./app/config/bundles/ik/audit-bundle/parameters.yml; \
+    composer install --no-scripts --no-interaction --no-progress; \
+    cd /opt; \
     chmod +x /opt/script.sh; \
     rm /etc/apt/apt.conf.d/00aptproxy; \
     rm -rf /var/lib/apt/lists/*

+ 5 - 1
bin/connect/FiberHome.py

@@ -12,10 +12,14 @@ class FiberHome(OLTBase):
         return "Password:"
 
     def get_write_exit(self):
-        return "quit"
+        return "exit"
 
     def run_enable(self):
         return True
 
     def get_character_error(self):
         return "%"
+
+    def get_expected_exit_with_confirmation(self):
+        return "Bye!"
+

+ 3 - 0
bin/connect/OLTBase.py

@@ -36,6 +36,9 @@ class OLTBase:
     def get_expected_exit(self):
         return None
 
+    def get_expected_exit_with_confirmation(self):
+        return None
+
     def get_write_exit_confirmation(self):
         return None
 

+ 10 - 7
bin/connect/ObjectTelnet.py

@@ -112,18 +112,21 @@ class ObjectTelnet(ObjectConnection):
         """
         if command.lower() == self.olt.get_write_exit().lower():
             self.tn.write(self.olt.get_write_exit() + self.NEW_LINE_UNIX)
+            read_data = None
+            with_confirmation = False
             if self.olt.get_expected_exit() is not None:
-                # data = self.tn.read_all()
-                position = self.read_data([self.olt.get_expected_cardinal(), self.olt.get_expected_exit()])
+                read_data = [self.olt.get_expected_cardinal(), self.olt.get_expected_exit()]
+                with_confirmation = True
+            if self.olt.get_expected_exit_with_confirmation() is not None:
+                read_data = [self.olt.get_expected_cardinal(), self.olt.get_expected_exit_with_confirmation()]
+                with_confirmation = False
+            if read_data is not None:
+                position = self.read_data(read_data)
                 if position == 2:
                     # quit terminal
+                    if with_confirmation:
                     self.tn.write(self.olt.get_write_exit_confirmation() + self.NEW_LINE_UNIX)
                     self.QUIT = False
-                # (i, obj, data) = self.tn.expect([self.olt.get_expected_cardinal(), self.olt.get_expected_exit()], 10)
-                # if self.olt.get_expected_exit() in data:
-                    # # quit terminal
-                    # self.tn.write(self.olt.get_write_exit_confirmation() + self.NEW_LINE_UNIX)
-                    # self.QUIT = False
             return True
         return False