foreman_packages 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
CHANGED
@@ -41,7 +41,9 @@ class ForemanPackages::SypackagesController < ApplicationController
|
|
41
41
|
# POST /sypackages.json
|
42
42
|
def create
|
43
43
|
@sypackage = ForemanPackages::Sypackage.new(params[:foreman_packages_sypackage])
|
44
|
-
|
44
|
+
if params[:foreman_packages_sypackage][:filename].present?
|
45
|
+
@sypackage.filename = params[:foreman_packages_sypackage][:filename].original_filename
|
46
|
+
end
|
45
47
|
respond_to do |format|
|
46
48
|
if @sypackage.save
|
47
49
|
format.html { redirect_to @sypackage, notice: 'ForemanPackages::Sypackage was successfully created.' }
|
@@ -11,13 +11,19 @@ class ForemanPackages::Sypackage < ActiveRecord::Base
|
|
11
11
|
#目前用 "/home/stdtnt/app/"代替 "/etc/puppet/environments/production/modules/packages"
|
12
12
|
#该处需要注意权限问题,当前用户是否具有该目录的操作权限
|
13
13
|
root_dir_name = "/etc/puppet/environments/production/modules/packages/"
|
14
|
+
/etc/puppet/environments/production/modules/packages
|
14
15
|
#self.destory_dir #默认删除该目录,然后重新创建
|
15
16
|
dir_exist_status = File.exist?(root_dir_name) #判断该目录是否存在
|
16
17
|
if !dir_exist_status
|
17
18
|
#创建目录结构
|
18
19
|
Dir::mkdir(root_dir_name)
|
19
|
-
|
20
|
-
|
20
|
+
if !File.exist?(root_dir_name + "files")
|
21
|
+
Dir::mkdir(root_dir_name + "files")
|
22
|
+
end
|
23
|
+
|
24
|
+
if !File.exist?(root_dir_name + "manifests")
|
25
|
+
Dir::mkdir(root_dir_name + "manifests")
|
26
|
+
end
|
21
27
|
|
22
28
|
#生成files下welcome.conf文件
|
23
29
|
files_welcome_File = File.new(root_dir_name + "files/welcome.conf", "w+")
|