]> SALOME platform Git repositories - tools/sat.git/blobdiff - src/architecture.py
Salome HOME
accept range 'version_1_0_0_to_2_0_0' as '_from_1_0_0_to_2_0_0'
[tools/sat.git] / src / architecture.py
index 75af0e461ea483e4da1340edc0156b1191277df6..c2cd5ba99c1230cf191804d3b6c6702699844699 100644 (file)
@@ -21,7 +21,7 @@ In this file : all the stuff that can change with the architecture
 on which SAT is running
 '''
 
-import os, sys, platform, pwd
+import os, sys, platform
 
 def is_windows():
     '''method that checks windows OS
@@ -41,6 +41,7 @@ def get_user():
             raise Exception('USERNAME environment variable not set')
         return os.environ['USERNAME']
     else: # linux
+        import pwd
         return pwd.getpwuid(os.getuid())[0]
 
 def _lsb_release(args):
@@ -87,7 +88,7 @@ def get_distribution(codes):
     else:
         sys.stderr.write(_(u"Unknown distribution: '%s'\n") % distrib)
         sys.stderr.write(_(u"Please add your distribution to"
-                           " data/distrib.pyconf\n"))
+                           " src/internal_config/distrib.pyconf\n"))
         sys.exit(-1)
 
     return distrib
@@ -113,6 +114,8 @@ def get_distrib_version(distrib, codes):
         if version in codes[distrib]:
             version = codes[distrib][version]
 
+    if distrib == "CO":
+        version=version[0]  #for centos, we only care for major version
     return version
 
 def get_python_version():
@@ -138,4 +141,4 @@ def get_nb_proc():
         nb_proc=multiprocessing.cpu_count()
     except :
         nb_proc=int(os.sysconf('SC_NPROCESSORS_ONLN'))
-    return nb_proc
\ No newline at end of file
+    return nb_proc